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

3.5.4 Mini Cart gives wrong number of items

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #11  
Old 04-20-2006, 08:33 AM
 
sundance sundance is offline
 

Member
  
Join Date: Oct 2004
Posts: 27
 

Default

However belated my thanks are

THANKS!

A great little mod that continues to function in my 4.0.17 iteration.

Excellent stuff as usual, Boom.
__________________
Xcart 4.0.17
Reply With Quote
  #12  
Old 07-23-2008, 04:43 PM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default Re: 3.5.4 Mini Cart gives wrong number of items

Just a note, this helpful mod still works in version 4.1.10
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #13  
Old 09-05-2008, 05:14 AM
 
c.vogels c.vogels is offline
 

Member
  
Join Date: Sep 2006
Posts: 18
 

Default Re: 3.5.4 Mini Cart gives wrong number of items

I've added this mod to x-cart gold 4.1.10. When i add 1 item to my cart, the minicart show's 2 items. When i add another (different) product, it will count +2 in the minicart. When i add the same product again it counts normal (+1).

Does someone know how to fix this. For example: http://www.kledingmetzorg.nl
__________________
x-cart 4.1.10 gold
Reply With Quote
  #14  
Old 11-19-2008, 09:21 PM
 
whsu716 whsu716 is offline
 

Senior Member
  
Join Date: Jun 2005
Posts: 168
 

Default Re: 3.5.4 Mini Cart gives wrong number of items

Got it:

Quote:
<?php
if ( !defined('XCART_START') ) { header("Location: home.php"); die("Access denied"); }

x_session_register ("cart");

$MINICART["total_cost"] = price_format(0);
$MINICART["total_items"] = 0;

if (!empty($cart)) {

if (!empty($cart["total_cost"])) {
if (!empty($active_modules["Fast_Lane_Checkout"]))
$MINICART["total_cost"] = $cart["display_subtotal"];
else
$MINICART["total_cost"] = $cart["total_cost"];
}

$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);

if(!empty($cart["products"])) {
foreach($cart["products"] as $key => $value) {
$MINICART["total_items"] += $value["amount"] - 1;
}
}


}

$smarty->assign("minicart_total_cost", $MINICART["total_cost"]);
$smarty->assign("minicart_total_items", $MINICART["total_items"]);
?>

Just needed to add the "-1"
__________________
...
v 4.0.18; 4.1
Reply With Quote
  #15  
Old 01-16-2009, 10:41 AM
 
Doctored Locks Doctored Locks is offline
 

Advanced Member
  
Join Date: Dec 2008
Posts: 42
 

Default Re: 3.5.4 Mini Cart gives wrong number of items

I just added it to ours (we also have anon carts and buy together). Works like a charm.
__________________
Version 4.1.11 Pro
Add-on: X-Affiliate
Add-on: X-RMA
Add-on: X-FancyCategories
Reply With Quote
  #16  
Old 03-23-2009, 02:27 AM
 
maximillian maximillian is offline
 

Advanced Member
  
Join Date: Jan 2009
Posts: 73
 

Default Re: 3.5.4 Mini Cart gives wrong number of items

Quote:
Originally Posted by whsu716
Got it:



Just needed to add the "-1"

I have the same problem and your post didn't help: when "add to cart" button is clicked, it adds twice more qty of products than it is choosed from the drop down qty list.

Can anyone suggest a fix for this?
__________________
X-Cart GOLD 4.1.11.
Reply With Quote
  #17  
Old 03-23-2009, 12:02 PM
 
maximillian maximillian is offline
 

Advanced Member
  
Join Date: Jan 2009
Posts: 73
 

Default Re: 3.5.4 Mini Cart gives wrong number of items

This is turning into nightmare!
I even returned to original version of minicart.php and I still get the same wrong result: I choose to add 2 pcs of one product and the cart shows 4 pcs. So it can't be this modification that is causing it.
__________________
X-Cart GOLD 4.1.11.
Reply With Quote
  #18  
Old 03-24-2009, 12:15 AM
  Victor D's Avatar 
Victor D Victor D is offline
 

X-Adept
  
Join Date: Aug 2008
Posts: 643
 

Default Re: 3.5.4 Mini Cart gives wrong number of items

Quote:
This is turning into nightmare!
I even returned to original version of minicart.php and I still get the same wrong result: I choose to add 2 pcs of one product and the cart shows 4 pcs. So it can't be this modification that is causing it.
Are the quantity of products is correct on the cart page?
__________________
Regards,
Victor Dubiniuk

X-Cart Skins Store
- twenty two different skins for 4.1.x and 4.2.x;
- 4.3.x compatible versions are available;
- refresh you store now!

Smart menu X-Cart add-on for 4.1.8 - 4.3.x
Featured Products Slide Show X-Cart add-on for 4.1.8 - 4.3.x
Reply With Quote
  #19  
Old 03-24-2009, 12:40 AM
 
maximillian maximillian is offline
 

Advanced Member
  
Join Date: Jan 2009
Posts: 73
 

Default Re: 3.5.4 Mini Cart gives wrong number of items

I don't know what to say. This morning everyhting works fine?!

Victor D, all qtys shown in minicart and cart are correct, the problem was when I wanted to add a product to cart. Instead of adding 1, 2 or more, when I clicked "add to cart" button once, it would add 2, 4 or twice more than it was choosed.

And now it's working correctly. I really don't know what was/is/again will be wrong???
__________________
X-Cart GOLD 4.1.11.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


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 11:07 AM.

   

 
X-Cart forums © 2001-2020