I'm of course trying to figure it out myself and so far my Delivery method page looks like this:
{Cart product=7} // this is one of the delivery methods products
{Cart action='viewcart' viewcarttemplate='viewcart_init'} // viewcart_init template is absolutely blank, I just get Cart variables filled in
and now, when I put there {$cartitems|print_r}, If i understand it right, i have there array with Objects, which represents Products. For sure, I'll put the output there, because I'm still not big friend with arrays and objects... (In this example, there are two products in cart: )
Code: Select all
stdClass Object ( [product_id] => 2 [sku] => 00301 [quantity] => 1 [base_price] => 0 [type] => 1 [pending] => [unit_weight] => 0 [unit_price] => 123 [summary] => Makové snění Platno - 20x30 (123.00) [item_total] => [file_location] => http://localhost/linnette-obrazy/uploads/Products/product_2 [flds] => Array ( [image] => stdClass Object *RECURSION* [pomer_stran] => stdClass Object *RECURSION* ) [categories] => Array ( [0] => stdClass Object ( [id] => 1 [name] => Bokeh [value] => [file_location] => http://localhost/linnette-obrazy/uploads/Products/categories/1 ) [1] => stdClass Object ( [id] => 2 [name] => Detail a zátiší [value] => [file_location] => http://localhost/linnette-obrazy/uploads/Products/categories/2 ) [2] => stdClass Object ( [id] => 3 [name] => Anything else [value] => [file_location] => http://localhost/linnette-obrazy/uploads/Products/categories/3 ) ) [quantity_box] => [remove_box] => ) stdClass Object ( [product_id] => 7 [sku] => [quantity] => 1 [base_price] => 100 [type] => 1 [pending] => [unit_weight] => 0 [unit_price] => 100 [summary] => Poštovné - Česká Pošta [item_total] => [file_location] => http://localhost/linnette-obrazy/uploads/Products/product_7 [flds] => Array ( [image] => stdClass Object *RECURSION* [pomer_stran] => stdClass Object *RECURSION* ) [categories] => Array ( [0] => stdClass Object ( [id] => 1 [name] => Bokeh [value] => [file_location] => http://localhost/linnette-obrazy/uploads/Products/categories/1 ) [1] => stdClass Object ( [id] => 2 [name] => Detail a zátiší [value] => [file_location] => http://localhost/linnette-obrazy/uploads/Products/categories/2 ) [2] => stdClass Object ( [id] => 3 [name] => Anything else [value] => [file_location] => http://localhost/linnette-obrazy/uploads/Products/categories/3 ) ) [quantity_box] => [remove_box] => ) Array Array
{foreach from objects in $cartitems}
{if id of product == x}
delete from $cartitems object with this id
{/if}
{/foreach}
So I hope, that you understand my crappy English and I will be very appreciated for any help or advice.