{init_order}
Tag {init_order} returns the orders. 3.3.7
Parameters
- name - variable name where the returned data is saved. Default value is "order".
- order_nr - the order number. If not defined, the last order in the database is returned.
Attributes
- order_nr - the order number
- date - the date of the order
- fdate - the date of the order in format yyyy-mm-dd
- sum - the sum of the order, monetary value
- vat - the VAT of the order, monetary value
- transport - the code of the transport type for the order. Transport codes can be arbitrary number values and are defined in the order template.
- status - the status of the order. Possible values are: Ordered, Dispatched, Delivered, Cancelled
- payment_status - the payment status of the order. Possible values are: Ordered, Kredit confirmed, Payed, Free, Refund.
- flast_modified - the date of the last modification of the order in format yyyy-mm-dd
- user_data - the content of the user data, saved as serialized array
- cart_data - the content of the cart, saved as serialized array
Example
{init_order order_nr=$order_nr}
<p>{sysword word="eel_arve" type="e_commerce" load_all=1} {$order_id}</p>
<table cellpadding="0" cellspacing="0">
<tr>
<th align=right>Kuupaev:</th>
<td>{$order->date}</td>
</tr>
<tr>
<th align=right>Nimi:</th>
<td>{$order->user_data.eesnimi} {$order->user_data.perekonnanimi}</td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<th>
<div align="left">Kaup</div>
</th>
<th>
<div align="right">Hind</div>
</th>
<th>
<div align="right">Kogus</div>
</th>
<th>
<div align="right">Summa</div>
</th>
</tr>
{foreach from=$order->cart_data item=cart}
<tr>
<td>
<div align="left">{$cart.title}</div>
</td>
<td>
<div align="right">{$cart.price}</div>
</td>
<td>
<div align="right">{$cart.qty}</div>
</td>
<td>
<div align="right">{$cart.sum}</div>
</td>
</tr>
{/foreach}
<tr>
<td>
<div align="left"></div>
</td>
<td>
<div align="right"></div>
</td>
<td>
<div align="right"></div>
</td>
<td>
<div align="right"></div>
</td>
</tr>
<tr>
<td colspan="3">
<div align="right">Saatekulud:</div>
</td>
<td>
<div align="right">{$order->transport}</div>
</td>
</tr>
<tr>
<td colspan="3">
<div align="right"><b>Kokku:</b></div>
</td>
<td>
<div align="right"><b>{$order->sum}</b></div>
</td>
</tr>
<tr>
<td colspan="3">
<div align="right">Kaibemaks</div>
</td>
<td>
<div align="right">{$order->vat}</div>
</td>
</tr>
</table>
