I'd like to display the total number of items in the cart somewhere on the site, how would I go about initializing that in the templates? Would I have to sum up $product['quantity'] or is there a faster method?
An example of expected results of:
1 x foo
3 x bar
4 items in the cart.
I want to add the total number of items in the module and have it updated with the ajax thing as you click "add to cart". Your method only adds to the header?
I've tried hacking the code in the cart.tpl file, but when the ajax updates the module my changes don't get made at all. But when I reload the page, the changes are there. Do you know how to change what the ajax function updates for the cart?
I did something like this to the cart.tpl file:
and somewhere else in the same file I put:
I've tried hacking the code in the cart.tpl file, but when the ajax updates the module my changes don't get made at all. But when I reload the page, the changes are there. Do you know how to change what the ajax function updates for the cart?
I did something like this to the cart.tpl file:
Code: Select all
$totalquantity = 0;
foreach ($products as $product) {
$totalquantity += $product['quantity'];
...
Code: Select all
echo $totalquantity;
Ah I figured out you have to edit the ../catalog/controller/module/cart.php file also in order to do it.
For anyone else that wants to do I wanted to do, you just have to add your changes in cart.tpl to the $output string in the cart.php file stated above.
For anyone else that wants to do I wanted to do, you just have to add your changes in cart.tpl to the $output string in the cart.php file stated above.
Who is online
Users browsing this forum: No registered users and 4 guests