Forums / General Questions / adding same product twice to shopping cart ...

adding same product twice to shopping cart ...

Locked

Views: 2,340

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
20 Jul 2006, 4:20 AM
#1
grossd avatar

grossd

Zen Follower

Join Date:
Sep 2005
Posts:
173
Plugin Contributions:
0

adding same product twice to shopping cart ...

Hello,

I would like to configure the add of products into the shopping cart, so that when the same product is choosen more than once, zencart doesnt add the quantity, but keeps each addition as a separate line item.

For example, if the customer does the following:

Add product A, quantity 200
Add product A, quantity 300

the resulting cart should have two items and not Product A, quantity 500.

Can this be configured?

thank you,

Daniel

20 Jul 2006, 4:45 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: adding same product twice to shopping cart ...

Zen Cart doesn't work that way ...

Unless there are attributes and the combo of attributes is different, the quanties are combined when in the cart ...

Why would you want to add 100 of Product A and 50 of Product B and 150 of Product A and see in the cart:

100 Product A
50 Product B
150 Product A

versus the normal way of:

250 Product A
50 Product B

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

20 Jul 2006, 5:15 AM
#3
grossd avatar

grossd

Zen Follower

Join Date:
Sep 2005
Posts:
173
Plugin Contributions:
0

Re: adding same product twice to shopping cart ...

Hello Ajeh,

Thank you for your prompt response.

The reason is the following:

The store will sell personalized booklets, where the cover of each booklet order can be customized. Customization is done by an external application i am writing, basically a mini cover design editor. This is because the attribut options entry methods are not sufficient to gather the graphcial information required.

The problem is that although within ZenCart each additional booklet order placed in the shopping cart appears the same, externally, each gets a different cover design assigned. To accomplish that I introduced a small change in the shipping_cart class, which adds a custom string into one predefined product attribute.

Unforunately, the add routine doesnt get called when zencart treats adding a product as a "change request" ... when a change routine in the shopping cart class is called, orders are already treated as combined.

thanks,

Daniel

p.s i guess i need to do more research to see where exactly zencart identifies that an add product request should be treated as changing an existing order in the shopping cart, and make attribute change already there.

20 Jul 2006, 4:22 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: adding same product twice to shopping cart ...

If you were using Text attributes ... they could fill in something to distinguish each one ... and that would make each entery to the cart unique ... so you could have multiple entrees for the same products_id ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

21 Jul 2006, 2:18 PM
#5
grossd avatar

grossd

Zen Follower

Join Date:
Sep 2005
Posts:
173
Plugin Contributions:
0

Re: adding same product twice to shopping cart ...

Hello Ajeh,

Thank you for your reply. It turns out that i have done exactly that :-)

Basically, i have added a text attributes to the product whose purpose is to index external information. I have then noted the name of that attribute, and placed it into a constant. Finally, i have added a short line of code in the attributes.php module, which checks the following field for that constant, when associated html code is generated.

($products_options_names->fields['products_options_name']

If its found then i generate own html code that fills in required indexing data, as well as makes the input field hidden.

appears to work (so far) :-)

thank you,

Daniel