/
view
57 lines (56 loc) · 2.13 KB
/
view
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
[% USE HTML %]
[% page.title = c.localize('PAGE_TITLE_CART'), page.id = 'cart' %]
[% INCLUDE includes/errors %]
[% IF cart.count %]
<table border="0" cellpadding="3" cellspacing="5">
<tr>
<th align="left">[% c.localize('LABEL_SKU') %]</th>
<th align="left">[% c.localize('LABEL_DESCRIPTION') %]</th>
<th align="center">[% c.localize('LABEL_QUANTITY') %]</th>
<th align="right">[% c.localize('LABEL_UNIT_PRICE') %]</th>
<th align="right">[% c.localize('LABEL_TOTAL') %]</th>
<th colspan="2"></th>
</tr>
[% FOREACH item = cart.items %]
<tr>
<td align="left">[% HTML.escape(item.sku) %]</td>
<td align="left">[% HTML.escape(item.description) %]</td>
<td align="center">
[% SET form = c.forms('cart_items_update') %]
[% CALL form.id(form.id _ '_' _ item.id) %]
[% form.render(
'action', c.uri_for_resource('mango/cart/items', 'update', [item.id]) _ '/',
'values', [item.quantity]
) %]
</td>
<td align="right">[% HTML.escape(item.price.as_string('FMT_SYMBOL')) %]</td>
<td align="right">[% HTML.escape(item.total.as_string('FMT_SYMBOL')) %]</td>
<td></td>
<td>
[% SET form = c.forms('cart_items_delete') %]
[% CALL form.id(form.id _ '_' _ item.id) %]
[% form.render(
'action', c.uri_for_resource('mango/cart/items', 'delete', [item.id]) _ '/'
) %]
</td>
</tr>
[% END %]
<tr>
<td colspan="7"></td>
</tr>
<tr>
<th colspan="4" align="right">[% c.localize('LABEL_SUBTOTAL') %]:</th>
<td align="right">[% HTML.escape(cart.subtotal.as_string('FMT_SYMBOL')) %]</td>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="7" align="right">
[% c.forms('cart_clear').render('action', c.uri_for_resource('mango/cart', 'clear') _ '/') %]
[% c.forms('checkout').render('action', c.uri_for_resource('mango/checkout') _ '/') %]
</td>
</tr>
</table>
[% c.forms('cart_save').render('action', c.uri_for_resource('mango/cart', 'save') _ '/') %]
[% ELSE %]
<p>[% c.localize('CART_IS_EMPTY') %]</p>
[% END %]