I am just starting to get to grips with OC3 (the last OC site I did was way back in 1.5.6.4). I am trying to add the quantity of cart items to the cart link in the very topmost bar of the header. In header.twig I have tried inserting the following:
Code: Select all
{ $products = $this->cart->getProducts(); $data['total'] = count($products); }
Code: Select all
{{ text_shopping_cart }}
Code: Select all
<li><a href="{{ shopping_cart }}" title="{{ text_shopping_cart }}"><i class="fa fa-shopping-cart"></i><span class="hidden-xs hidden-sm hidden-md"> { $products = $this->cart->getProducts(); $data['total'] = count($products); }{{ text_shopping_cart }}</span></a></li>
Code: Select all
%s item(s) - %sShopping Cart
(3) Shopping Cart
I'd be grateful if someone could give me a nudge in the right direction please.
Thanks,
Paul.
Using OC 3.0.2.0
Site: http://freshmistletoe.co.uk