-
Mini Cart
Hi,
I want to have a mini cart on my page, but I only want to show the number of items in the cart.
I've tried to use <?php echo count($this->products); ?> in a custom template but this only shows how many individual items are in the cart. ie, if I have 2 products but have a quantity of 5 for one of them - 6 items, the above code only shows 2.
Is there a variable that will give me total quantity of all products in the cart? Or will I need to use some custom php to add everything up?
Thanks
James
-
Re: Mini Cart
Try this:
Code:
<?php $qty=0; ?>
<?php foreach($this->products as $product): ?>
<?php $qty += $product['quantity']; ?>
<?php endforeach; ?>
<?php echo $qty; ?>
You can get it with $this->Isotope->Cart->items within the module, but since it is not currently assigned to the template object within the module, not sure it can be grabbed like that. I will add a ticket and see if we can get this added so it can be referenced like $this->items...
-
Re: Mini Cart
-
Re: Mini Cart
Hi!
Another question about miniCart: when i have no items in cart, i see message like this "There are no items in your cart" istead of cart modile.
How can i add this message to card module and saw it regardless of the number of items in cart?