X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Changing the number of items in mini cart to the actual # of items in minicart (https://forum.x-cart.com/showthread.php?t=29370)

paryaei 03-04-2007 10:42 PM

Changing the number of items in mini cart to the actual # of items in minicart
 
Does any body know how to alter the minicart.php file to show the actual number of items (products) in the mini cart ??
For example currently :

if someone adds a quantity of 3, but from 1 item it will say:

---> Items: 1

but i would like to see it saying Items: 3

I found some old code from 2002-2003 that dont work for 4.1.6
any help is appreciate it....

balinor 03-05-2007 06:49 AM

Re: Changing the number of items in mini cart to the actual # of items in minicart
 
Moving to Template Editing

inebriate 03-05-2007 03:06 PM

Re: Changing the number of items in mini cart to the actual # of items in minicart
 
i know the following works in 4.0.x but dont know about 4.1.x

in minicart.php change
Code:

$MINICART["total_items"] = ((!empty($cart["products"]) and is_array($car
t["products"]))?count($cart["products"]):0) + ((!empty($cart["giftcerts"]) and i
s_array($cart["giftcerts"]))?count($cart["giftcerts"]):0);

to
Code:

$MINICART["total_items"] = 0;

if (!empty($cart["products"]) and is_array($cart["products"])) {
foreach ($cart["products"] as $_tmp)
$MINICART["total_items"] += $_tmp["amount"];
}
if (!empty($cart["giftcerts"]) and is_array($cart["giftcerts"]))
$MINICART["total_items"] +=$cart["giftcerts"];


paryaei 03-05-2007 07:02 PM

Re: Changing the number of items in mini cart to the actual # of items in minicart
 
Thank you so much . it works perfectly with 4.1.6
thanks for sharing....

doczim 03-06-2007 02:23 AM

Re: Changing the number of items in mini cart to the actual # of items in minicart
 
worked great for 4.1.3

thanks

Stinkweasels 12-26-2007 11:56 AM

Re: Changing the number of items in mini cart to the actual # of items in minicart
 
I can't find that in mine Gold v4.1.9?

Stinkweasels 12-30-2007 05:35 AM

Re: Changing the number of items in mini cart to the actual # of items in minicart
 
Figured it out why I couldn't find the file. Its on the server, not edit templates. Yes, I know, I'm a noob. Works on my version btw:mrgreen:

Stinkweasels 04-02-2008 04:23 PM

Re: Changing the number of items in mini cart to the actual # of items in minicart
 
I decided to activate the gift certificate module and it says there's a fatal error in line 60 of the minicart.php?

kube 04-02-2008 05:07 PM

Re: Changing the number of items in mini cart to the actual # of items in minicart
 
This is untested, how about changing the last line from...

$MINICART["total_items"] +=$cart["giftcerts"];

to...

$MINICART["total_items"] += count($cart["giftcerts"]);

Stinkweasels 04-02-2008 05:13 PM

Re: Changing the number of items in mini cart to the actual # of items in minicart
 
That appears to work:lol: :lol: :lol: :D/


All times are GMT -8. The time now is 03:14 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.