{if empty($order)}




[`There are no orders in this view.`]
{else}
{if count($printable_docs)}


{/if}

[`Order created`]: {$order.create_datetime|wa_datetime:"humandatetime"}
{if !empty($order.params.referer)}[`Referrer`]: {$order.params.referer|truncate:42}
{/if} {if !empty($order.params.storefront)}[`Storefront`]: {$order.params.storefront}
{/if} {if !empty($order.params.keyword)}[`Keyword`]: {$order.params.keyword}
{/if} {if !empty($order.params.ip)}[`IP`]: {$order.params.ip}
{/if} {* @event backend_order.%plugin_id%.aux_info *} {if !empty($backend_order)}{foreach $backend_order as $_}{if (!empty($_.aux_info))}{$_.aux_info}
{/if}{/foreach}{/if}

{$wa->shop->orderId($order.id)} {* @event backend_order.%plugin_id%.title_suffix *} {if !empty($backend_order)}{foreach $backend_order as $_}{ifset($_.title_suffix)}{/foreach}{/if} {if $order.state} {$order.state->getName()} {if $last_action_datetime} {$last_action_datetime|wa_datetime:'humandatetime'} {$last_action_datetime|wa_datetime:'datetime'} {/if} {else} [`Unknown state`]: {$order.state_id} {/if}

{$order.contact.name} {if $customer.number_of_orders == 1} [`This is the first order placed by this customer`] {else} {_w('%d order', '%d orders', $customer.number_of_orders)} {/if}

{if $main_contact_info} {/if}
{* @event backend_order.%plugin_id%.info_section *} {if !empty($backend_order)}{foreach $backend_order as $_}{if (!empty($_.info_section))}{$_.info_section}{/if}{/foreach}{/if}
{if $order.comment}
{$order.comment|escape}
{/if} {if $shipping_address}
{/if}

[`Shipping`]{if !empty($params.shipping_name)} —{/if} {ifset($params.shipping_name)}

{if $shipping_address !== null}

{$shipping_address}

{if !empty($custom_fields)}

{foreach $custom_fields as $f} {$f.title}: {$f.value}
{/foreach}

{/if} {if !empty($params.tracking_number)}

[`Shipment tracking number`]: {$params.tracking_number}

{/if} {if !empty($tracking) && $order.state_id != 'completed'}
{$tracking}
{/if} {/if} {if !empty($params.payment_name)}

[`Payment`] — {$params.payment_name}

{if $billing_address !== null}

{$billing_address}

{/if} {/if} {if !empty($order.coupon)}

[`Discount`] ({$order.coupon.code})

{/if}
{if $order.items} {$subtotal = 0} {foreach $order.items as $item} {$subtotal = $subtotal + $item.price*$item.quantity} {/foreach} {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, 'ext' => $item.ext], '48x48')} {else} {/if} {/if} {if $item.type == 'service'}+ {/if} {$item.name} {if !empty($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} {wa_currency($item.price, $order.currency)} × {$item.quantity} {wa_currency($item.price * $item.quantity, $order.currency)}

[`Subtotal`]

{wa_currency($subtotal, $order.currency)}
[`Discount`] − {wa_currency($order.discount, $order.currency)}
[`Shipping`] {wa_currency($order.shipping, $order.currency)}
[`Tax`] {wa_currency($order.tax, $order.currency)}
[`Total`] {wa_currency($order.total, $order.currency)}
{/if} {* *}

[`Order timeline`]


{foreach $bottom_buttons as $b} {$b} {/foreach}

{foreach $log as $row}
{$row.datetime|wa_datetime:"humandatetime"}
{if $row.action_id} {if $row.contact_id} {$row.contact_name|escape} {elseif $row.action_id == 'callback' && $row.text} {$_tmp = explode(' ', $row.text, 2)} {$pl = shopPayment::getPluginInfo($_tmp[0])} {$row.text = $_tmp[1]} {$pl.name|escape} {/if} {if $row.action}{$row.action->getOption('log_record')}{else}{$row.action_id}{/if} {if $row.text}

{$row.text}

{/if} {else} {if $row.text} {$row.text}{/if} {/if}
{/foreach}
{/if}