![]() |
Items in Cart - Doesn't count quantities
Currently - our "items in cart" is not counting the quantity of items. It only counts how many unique items there are in the cart.
Is there an easy way to modify this to count the total amount of items - including their quantities (so if there were 2 different items, each with quantity of 10 - it would show 20) |
Re: Items in Cart - Doesn't count quantities
|
Re: Items in Cart - Doesn't count quantities
Well - that shows the not-so-goodness of xcart forums search function...
That thread helped - thank you. |
Re: Items in Cart - Doesn't count quantities
All depends on what you search for. The new forum search is fine, just need the keywords is all. Thread came right up for me.
|
Re: Items in Cart - Doesn't count quantities
I actually took this code and changed it a little bit. Instead of replacing the code in minicart.php I added it.
Here is what I did: 1. Open minicart.php and add Code:
$MINICART["total_products"] = 0; Code:
$MINICART["total_items"] = 0; Code:
$MINICART["total_items"] = ((!empty($cart["products"]) and is_array($cart["products"]))?count($cart["products"]):0) + ((!empty($cart["giftcerts"]) and is_array($cart["giftcerts"]))?count($cart["giftcerts"]):0); Code:
$MINICART["total_items"] Code:
$MINICART["total_products"] Code:
if (!empty($cart["products"]) and is_array($cart["products"])) { Code:
$smarty->assign("minicart_total_products", $MINICART["total_products"]); 6. Then open customer/main/minicart.tpl and add the new variable "minicart_total_products" where you want it to appear. Something like this Code:
<tr> Attachment 597 |
Re: Items in Cart - Doesn't count quantities
moving to completed mods...
|
All times are GMT -8. The time now is 10:08 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.