[%# $Id$ %]
[% USE hcart = Handel.Cart %]
[% IF (cart = hcart.create({
description => 'My New Shopping Cart',
id => '89C8C2E3-3170-4E9D-81DC-9E572E102FB8',
name => 'New Cart',
shopper => '73C7A602-C18D-4B22-BD57-FF383D2AA5ED',
type => hcart.CART_TYPE_TEMP
})) %]
[% CALL cart.add({
description => 'Description 1',
id => 'A07077F7-C31D-44CD-B2E2-7AE7FA358C11',
price => 1.11,
quantity => 1,
sku => 'SKU1'
}) %]
[% CALL cart.add({
description => 'Description 2',
id => 'E0E20484-A9EE-4CCA-BF02-6E3F3D27EA9A',
price => 2.22,
quantity => 2,
sku => 'SKU2'
}) %]
[% ELSE %]
Error creating shopping cart
[% END %]
[% IF (cart = hcart.search({
type => hcart.CART_TYPE_TEMP,
id => '89C8C2E3-3170-4E9D-81DC-9E572E102FB8'
}).first) %]
[% cart.count %]
[% cart.description %]
[% cart.id %]
[% cart.name %]
[% cart.shopper %]
[% cart.subtotal.value %]
[% cart.type %]
[% items = cart.items({sku => 'FOO%'}) %]
[% IF items.count %]
[% WHILE (item = items.next) %]
-
[% item.description %]
[% item.id %]
[% item.price.value %]
[% item.quantity %]
[% item.sku %]
[% item.total.value %]
[% END %]
[% ELSE %]
Cart item not found
[% END %]
[% ELSE %]
Could not find cart
[% END %]