Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Changing the number of items in mini cart to the actual # of items in minicart

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-04-2007, 10:42 PM
 
paryaei paryaei is offline
 

Senior Member
  
Join Date: Jun 2006
Posts: 112
 

Default 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....
__________________
Paryaei
Xcart pro version: 4.1.12
& All the X-cart add ons
& Heavily moded
Reply With Quote

The following user thanks paryaei for this useful post:
Stizerg (05-14-2011)
  #2  
Old 03-05-2007, 06:49 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Changing the number of items in mini cart to the actual # of items in minicart

Moving to Template Editing
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 03-05-2007, 03:06 PM
 
inebriate inebriate is offline
 

eXpert
  
Join Date: May 2006
Posts: 301
 

Default 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"];
__________________
x-cart pro 4.0.18
linux
www.fabric8d.com (currently undergoing construction)
Reply With Quote

The following user thanks inebriate for this useful post:
dtgmap (12-26-2012)
  #4  
Old 03-05-2007, 07:02 PM
 
paryaei paryaei is offline
 

Senior Member
  
Join Date: Jun 2006
Posts: 112
 

Default 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....
__________________
Paryaei
Xcart pro version: 4.1.12
& All the X-cart add ons
& Heavily moded
Reply With Quote
  #5  
Old 03-06-2007, 02:23 AM
 
doczim doczim is offline
 

Advanced Member
  
Join Date: Feb 2007
Location: Queensland , Australia
Posts: 30
 

Default Re: Changing the number of items in mini cart to the actual # of items in minicart

worked great for 4.1.3

thanks
__________________
X-Cart Version 4.1.3 ; PHP 4.4.2 ; MySQL server 4.1.18
Server Apache/2.0.53 (Fedora) ; OS Linux
www.outofinkandtoner.com.au
Reply With Quote
  #6  
Old 12-26-2007, 11:56 AM
 
Stinkweasels Stinkweasels is offline
 

Advanced Member
  
Join Date: Dec 2007
Posts: 45
 

Default 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?
__________________
X-Cart Gold v4.1.10

www.stinkweasels.com
Reply With Quote
  #7  
Old 12-30-2007, 05:35 AM
 
Stinkweasels Stinkweasels is offline
 

Advanced Member
  
Join Date: Dec 2007
Posts: 45
 

Default 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
__________________
X-Cart Gold v4.1.10

www.stinkweasels.com
Reply With Quote
  #8  
Old 04-02-2008, 04:23 PM
 
Stinkweasels Stinkweasels is offline
 

Advanced Member
  
Join Date: Dec 2007
Posts: 45
 

Default 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?
__________________
X-Cart Gold v4.1.10

www.stinkweasels.com
Reply With Quote
  #9  
Old 04-02-2008, 05:07 PM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default 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"]);
__________________
Doms
kube v4.1.9
Reply With Quote

The following user thanks kube for this useful post:
Stizerg (05-14-2011)
  #10  
Old 04-02-2008, 05:13 PM
 
Stinkweasels Stinkweasels is offline
 

Advanced Member
  
Join Date: Dec 2007
Posts: 45
 

Default Re: Changing the number of items in mini cart to the actual # of items in minicart

That appears to work
__________________
X-Cart Gold v4.1.10

www.stinkweasels.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020