{* CSS *} {$wa->css()} {* JS *}
{if !empty($order)}
{* CONTENT *}
{* TITLE *}

{$wa->shop->orderId($order.id)} {if $order.state} {$order.state->getName()|escape} {if $last_action_datetime} {$last_action_datetime|wa_datetime:'datetime'} {/if} {else} [`Unknown state`]: {$order.state_id} {/if}

{* PAID BADGE *} {if !empty($order.paid_date)}
[`Paid`]
{elseif !empty($order.auth_date)}
[`Payment authorized`]
{/if}
{* CUSTOMER INFO *}
{* MAP *} {if $shipping_address}
{$map}
{/if}
{* ORDER COMMENT *} {if $order.comment}
{$order.comment|escape}
{/if} {$has_payment = !empty($params.payment_name)} {$has_shipping = !empty($params.shipping_name)} {$has_shipping_address = !empty($shipping_address)} {if $has_shipping_address || $has_payment || $has_shipping}
{* SHIPPING *}
{if $has_shipping_address || $has_shipping}
[`Shipping`]{if $has_shipping} —{/if} {ifset($params.shipping_name)}
{if $shipping_address}

{$shipping_address}

{if !empty($shipping_custom_fields)}

{foreach $shipping_custom_fields as $f} {$f.title}: {$f.value|escape}
{/foreach}

{/if} {if $customer_delivery_date || $customer_delivery_date_str}

[`Preferred shipping time:`] {if $customer_delivery_date} {wa_date('date', $customer_delivery_date, waDateTime::getDefaultTimezone())|escape} {elseif $customer_delivery_date_str} {$customer_delivery_date_str|escape} {/if} {if $customer_delivery_time} {if $customer_delivery_date}   {/if} {$customer_delivery_time.from_hours|escape}:{$customer_delivery_time.from_minutes|escape} - {$customer_delivery_time.to_hours|escape}:{$customer_delivery_time.to_minutes|escape} {/if}

{/if} {if !empty($courier)}
[`Courier`] — {$courier.name|escape}
{/if} {strip} {$edit_shipping_details_available = false} {if !empty($order.state)} {$available_actions = $order.state->getActions()} {$edit_shipping_details_available = !empty($available_actions.editshippingdetails)} {/if} {if $edit_shipping_details_available || !empty($shipping_date)}

{if !empty($shipping_date)} [`Shipping time`]: {wa_date('date', $shipping_date, waDateTime::getDefaultTimezone())|escape} {$shipping_time_start|escape} - {$shipping_time_end|escape} {if !empty($order.state)}
{/if} {/if}

{/if} {/strip} {/if} {if !empty($params.tracking_number)}
[`Shipment tracking number`] — {$params.tracking_number|escape}
{/if} {if !empty($tracking) && $order.state_id != 'completed'}
{$tracking}
{/if} {/if}
{* PAYMENT *} {if $has_payment}
[`Payment`] — {$params.payment_name}
{if !empty($order.paid_date)}

{sprintf('[`Order was paid on %s`]', $order.paid_date|wa_date:'humandate')}

{/if} {if $billing_address !== null}

{$billing_address}

{/if}
{/if}
{/if}
{* ORDER CONTENT *} {if $order.items} {$subtotal = 0} {foreach $order.items as $item} {$subtotal = $subtotal + $item.price*$item.quantity} {/foreach} {else} {/if} {if isset($params.shipping_name) || $order.shipping > 0} {/if}
[`Qty`] [`Total`]
{if $item.type != 'service'} {if !empty($item.image_id)} {$wa->shop->productImgHtml(['id' => $item.product_id, 'image_id' => $item.image_id, 'image_filename' => $item.image_filename, 'ext' => $item.ext], '48x48')} {else} {/if} {/if} {if $item.type == 'service'}+ {/if} {$item.name|escape|default:"[`(no name)`]"} {if isset($item.sku_code)}
{$item.sku_code|escape} {/if} {if !empty($item.stock)}
@{$item.stock.name|escape} {/if} {if !empty($item.stock_icon)}
{$item.stock_icon} {/if}
× {$item.quantity}
{wa_currency_html($item.price, $order.currency)} {if !empty($item.stock_unit)} {$item.stock_unit.name_short|escape} {/if}
{wa_currency_html($item.price * $item.quantity, $order.currency)}

[`Subtotal`]

{wa_currency_html($subtotal, $order.currency)}
[`Order content is unknown`]
[`Discount`] {if !empty($order.coupon)} {$order.coupon.code|escape} {/if} − {wa_currency_html($order.discount, $order.currency)}
[`Shipping`] {wa_currency_html($order.shipping, $order.currency)}
[`Tax`] {wa_currency_html($order.tax, $order.currency)}
[`Total`] {wa_currency_html($order.total, $order.currency)}
{/if}