{extends file="admin-layout.tpl"} {block name="no-return-functions"} {$admin_current_location = 'order'} {/block} {block name="page-title"}{intl l='Edit an order'}{/block} {block name="check-resource"}admin.order{/block} {block name="check-access"}update{/block} {block name="main-content"} {assign order_tab {$tab|default:$smarty.get.tab|default:"cart"}}
{hook name="order-edit.top" order_id=$order_id}
{ifloop rel='the-order'} {loop type="order" name="the-order" id=$order_id customer="*" with_prev_next_info="true" backend_context="1"} {loop type="currency" name="order-currency" id=$CURRENCY} {$orderCurrency=$SYMBOL} {/loop} {assign "orderStatusId" $STATUS}
{intl l='Order %ref - ID %id' id={$ID} ref={$REF}}
{if $HAS_PREVIOUS != 0} {else} {/if} {if $HAS_NEXT != 0} {else} {/if}
{hookblock name="order.tab" id={$order_id} fields="id,title,href,content"} {capture "order_tab_tab"} {forhook rel="order.tab"}
  • {$title}
  • {/forhook} {/capture} {capture "order_tab_content"} {forhook rel="order.tab"}
    {if $href} {* ajax *}
    {intl l="Please wait, loading"}
    {else} {$content nofilter} {/if}
    {/forhook} {/capture} {/hookblock}
    {hook name="order-edit.cart-top" location="order-edit-cart-top" order_id=$order_id}
    {if $smarty.get.update_status_error_message}
    {$smarty.get.update_status_error_message}
    {/if} {hook name="order-edit.before-order-product-list" location="before-order-product-list" order_id=$order_id} {hook name="order-edit.order-product-table-header" location="order_edit_table_header" } {loop type="order_product" name="order-products" order=$ID} {if $WAS_IN_PROMO == 1} {assign "realPrice" $PROMO_PRICE} {assign "realTax" $PROMO_PRICE_TAX} {assign "realTaxedPrice" $TAXED_PROMO_PRICE} {assign "realTotalPrice" $TOTAL_TAXED_PROMO_PRICE} {else} {assign "realPrice" $PRICE} {assign "realTax" $PRICE_TAX} {assign "realTaxedPrice" $TAXED_PRICE} {assign "realTotalPrice" $TOTAL_TAXED_PRICE} {/if} {hook name="order-edit.before-order-product-row" location="before-order-product-row" order_id=$order_id order_product_id=$ID} {hook name="order-edit.order-product-table-row" location="order_edit_table_row" order_product_id={$ID} } {hook name="order-edit.after-order-product-row" location="after-order-product-row" order_id=$order_id order_product_id=$ID} {/loop}
    {intl l='Cart - Prices in %currency' currency={$orderCurrency}}
    {intl l="Product"}{intl l="Unit. price"} {intl l="Tax"} {intl l="Unit taxed price"} {intl l="Quantity"} {intl l="Taxed total"}
    {ifloop rel="my_product_loop"} {loop type="product" name="my_product_loop" visible="*" ref=$REF return_url=false} {$REF} - {$TITLE} {if $VIRTUAL}{/if} {/loop}
    {intl l='Combination reference'}
    {$PRODUCT_SALE_ELEMENTS_REF}
    {/ifloop} {elseloop rel="my_product_loop"} {* The product doesn't exist anymore *} {$TITLE} {if $VIRTUAL}{/if} {/elseloop} {ifloop rel="combinations"}
    {loop type="order_product_attribute_combination" name="combinations" order_product=$ID}
    {$ATTRIBUTE_TITLE}
    {$ATTRIBUTE_AVAILABILITY_TITLE}
    {/loop}
    {/ifloop} {hook name="order-edit.product-list" location="order-product-list" order_id=$order_id order_product_id=$ID}
    {format_money number=$realPrice currency_id=$CURRENCY} {format_money number=$realTax currency_id=$CURRENCY} {format_money number=$realTaxedPrice currency_id=$CURRENCY} {$QUANTITY} {format_money number=$realTotalPrice currency_id=$CURRENCY}
    {intl l="Total without discount"} {format_money number=$TOTAL_TAXED_AMOUNT-$POSTAGE+$DISCOUNT currency_id=$CURRENCY}
    {intl l="Discount"} {format_money number=$DISCOUNT currency_id=$CURRENCY}
    {intl l="Coupon code"} {loop type="order_coupon" name="couponcode" order=$ID} {$CODE}{if $LOOP_COUNT != $LOOP_TOTAL}, {/if} {/loop} {elseloop rel="couponcode"} Ø {/elseloop}
    {intl l="Total including discount"} {format_money number=$TOTAL_TAXED_AMOUNT-$POSTAGE currency_id=$CURRENCY}
    {intl l="Postage"} {format_money number=$POSTAGE currency_id=$CURRENCY} ({format_money number=$POSTAGE_TAX currency_id=$CURRENCY})
    {intl l="Weight"} {format_number number=$WEIGHT} {intl l="Kg"}
    {intl l="Total"} {format_money number=$TOTAL_TAXED_AMOUNT currency_id=$CURRENCY}
    {hook name="order-edit.after-order-product-list" location="after-order-product-list" order_id=$order_id}
    {loop type="order_address" name="order-invoice-address" id=$INVOICE_ADDRESS} {assign "orderInvoiceFirstName" $FIRSTNAME} {assign "orderInvoiceLastName" $LASTNAME} {assign "orderInvoiceCompany" $COMPANY} {/loop}
    {if $orderInvoiceCompany} {/if}
    {intl l='Customer information'}
    {intl l="Customer"} {$orderInvoiceFirstName|ucwords} {$orderInvoiceLastName|upper}
    {intl l="Company"} {$orderInvoiceCompany}
    {hook name="order-edit.customer-information-bottom" order_id=$order_id customer_id=$CUSTOMER}
    {intl l='Payment information'}
    {intl l="Payment module"} {loop name="payment-module" type="module" id=$PAYMENT_MODULE}{$CODE} - {$TITLE}{/loop}
    {intl l="Transaction reference"} {$TRANSACTION_REF}
    {hook name="order-edit.payment-module-bottom" order_id=$order_id module_id=$PAYMENT_MODULE}
    {hook name="order-edit.cart-bottom" location="order-edit-cart-bottom" order_id=$order_id}
    {hook name="order-edit.bill-top" location="order-edit-bill-top" order_id=$order_id}
    {intl l='Delivery module'}
    {loop name="delivery-module" type="module" id=$DELIVERY_MODULE}
    {intl l="Name"}
    {$CODE} - {$TITLE}
    {intl l="Description"}
    {$DESCRIPTION nofilter}
    {hook name="order-edit.delivery-module-bottom" order_id=$order_id module_id=$DELIVERY_MODULE} {/loop} {if $smarty.get.update_status_error_message}
    {$smarty.get.update_status_error_message}
    {/if}
    {loop type="order_address" name="order-invoice-address" id=$INVOICE_ADDRESS} {/loop}
    {intl l='Invoice informations'}
    {intl l="Invoice reference"} {$INVOICE_REF}
    {intl l="Invoice date"} {format_date date=$INVOICE_DATE output="date"}
    {intl l="Company"} {$COMPANY}
    {intl l="Title"} {loop type="title" name="order-invoice-address-title" id=$TITLE}{$LONG}{/loop}
    {intl l="Firstname"} {$FIRSTNAME}
    {intl l="Lastname"} {$LASTNAME}
    {intl l="Street address"} {$ADDRESS1}
    {intl l="Additional address"} {$ADDRESS2}
    {intl l="Additional address"} {$ADDRESS3}
    {intl l="Zip code"} {$ZIPCODE}
    {intl l="City"} {$CITY}
    {intl l="Country"} {loop type="country" name="order-invoice-address-country" id=$COUNTRY visible="*"}{$TITLE}{/loop}
    {intl l="State"} {if $STATE} {loop type="state" name="order-invoice-address-state" id=$STATE visible="*"}{$TITLE}{/loop} {else} - {/if}
    {intl l="Phone"} {$PHONE}
    {intl l="Cellphone"} {$CELLPHONE}
    {ifhook rel="order-edit.bill-delivery-address"} {* delivery module can customize the delivery address *} {hook name="order-edit.bill-delivery-address" module="$DELIVERY_MODULE" order_id={$order_id}} {/ifhook} {elsehook rel="order-edit.bill-delivery-address"} {loop type="order_address" name="order-delivery-address" id=$DELIVERY_ADDRESS} {/loop} {/elsehook}
    {intl l='Delivery address'}
    {intl l="Company"} {$COMPANY}
    {intl l="Title"} {loop type="title" name="order-delivery-address-title" id=$TITLE}{$LONG}{/loop}
    {intl l="Firstname"} {$FIRSTNAME}
    {intl l="Lastname"} {$LASTNAME}
    {intl l="Street address"} {$ADDRESS1}
    {intl l="Additional address"} {$ADDRESS2}
    {intl l="Additional address"} {$ADDRESS3}
    {intl l="Zip code"} {$ZIPCODE}
    {intl l="City"} {$CITY}
    {intl l="Country"} {loop type="country" name="order-delivery-address-country" id=$COUNTRY visible="*"}{$TITLE}{/loop}
    {intl l="State"} {if $STATE} {loop type="state" name="order-delivery-address-state" id=$STATE visible="*"}{$TITLE}{/loop} {else} - {/if}
    {intl l="Phone"} {$PHONE}
    {intl l="Cellphone"} {$CELLPHONE}
    {hook name="order-edit.bill-bottom" location="order-edit-bill-bottom" order_id=$order_id}
    {$smarty.capture.order_tab_content nofilter}
    {* ugly fix : {hook name="order.tab-content"} *} {include file="includes/module-tab-content.html" hook="order.tab-content" location="order-edit" id=$order_id view="order-edit"}
    {/loop} {/ifloop} {elseloop rel="the-order"} DOES NOT EXISTS {/elseloop}
    {hook name="order-edit.bottom" order_id=$order_id}
    {* Update an Address *} {form name="thelia.order.update.address"} {* Capture the dialog body, to pass it to the generic dialog *} {capture "edit_order_address_dialog"} {form_hidden_fields} {form_field field='id'} {/form_field} {form_field field='company'}
    {/form_field} {form_field field='title'}
    {/form_field} {form_field field='firstname'}
    {/form_field} {form_field field='lastname'}
    {/form_field} {form_field field='address1'}
    {form_field field='address2'} {/form_field}
    {form_field field='address3'} {/form_field}
    {/form_field} {form_field field='zipcode'}
    {/form_field} {form_field field='city'}
    {/form_field} {form_field field='country'} {$countryFieldId=$label_attr.for}
    {/form_field} {form_field field='state'}
    {/form_field} {form_field field='phone'}
    {/form_field} {form_field field='cellphone'}
    {/form_field} {/capture} {include file = "includes/generic-create-dialog.html" dialog_id = "edit_order_address_dialog" dialog_title = {intl l="Edit order address"} dialog_body = {$smarty.capture.edit_order_address_dialog nofilter} dialog_ok_label = {intl l="Confirm changes"} dialog_cancel_label = {intl l="Cancel"} form_action = {url path="/admin/order/update/%id/address" id=$order_id} form_enctype = {form_enctype} form_error_message = $form_error_message form_id = 'updateOrderAddressForm' } {/form} {/block} {block name="javascript-initialization"} {javascripts file='assets/js/bootstrap-select/bootstrap-select.js'} {/javascripts} {javascripts file='assets/js/thelia-states.js'} {/javascripts} {/block} {block name="javascript-last-call"} {hook name="order.edit-js" location="order-edit-js" order_id={$order_id} } {/block}