Zen Cart Logo
Forums / Contribution-Writing Guidelines / shoppingCart->add_cart quantity?

shoppingCart->add_cart quantity?

Views: 2,324

Results 1 to 3 of 3
15 Feb 2011, 12:29 PM
#1
tlahtine avatar

tlahtine

New Zenner

Join Date:
Jul 2010
Posts:
36
Plugin Contributions:
0

shoppingCart->add_cart quantity?

I'm writing a modification where I add products to the shoppingCart with add_cart function. However, in a case where there is already one product with the same id, the product is not added, but the amount remains 1.

Debugging the code it seems that add_cart calls update_quatity, which updates the quantity to 1.

Is the correct way to use add_cart when adding the new product really add_cart($products_id, $number_of_exising+1) ?

To me this is not logical and not in line with the comments in the source file...

15 Feb 2011, 12:34 PM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: shoppingCart->add_cart quantity?

That is not how a stock install works as it increments the quantiyu

20 Feb 2011, 4:15 PM
#3
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,073
Plugin Contributions:
56

Re: shoppingCart->add_cart quantity?

Are your products defined with a "Product Qty. Maximum" value? It sounds like they might be defined with a maximum of 1 ...