Zen Cart Logo
Forums / General Questions / I need help in stopping "adjust_quantity"

I need help in stopping "adjust_quantity"

Locked

Views: 725

Results 1 to 7 of 7
This thread is locked. New replies are disabled.
5 Jun 2008, 5:14 PM
#1
noone avatar

noone

New Zenner

Join Date:
Jun 2008
Location:
Utah, US.
Posts:
26
Plugin Contributions:
0

I need help in stopping "adjust_quantity"

Hello all, let me start off by saying zen cart is GREAT!!!
and please buy your zen cart members a cup of coffee.

the problem i am having is this: i have a small t shirt printing business, and when a customer tries to order 2 or more of the same shirt with their own images (that they upload - front and back) instead of the shopping cart seeing this as 2 separate orders, it attempts to add the quantity to the prior order and discards the second set of images.

in other words:

customer orders T-Shirt "A', then selects attribute quantity "100" and uploads front + back image.
Then
customer orders another T-Shirt "A', then selects attribute quantity "100" and uploads DIFFERENT front + back image.

the cart does not see these orders as separate, and attempts to combine them and discards the second set of images.

what am i doing wrong?

Thanking you in advance.

NooNe

7 Jun 2008, 1:47 AM
#2
noone avatar

noone

New Zenner

Join Date:
Jun 2008
Location:
Utah, US.
Posts:
26
Plugin Contributions:
0

Re: I need help in stopping "adjust_quantity"

Thanks, got it.

7 Jun 2008, 5:00 AM
#3
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: I need help in stopping "adjust_quantity"

NooNe:

Thanks, got it.
Why not help other forum members, who may experience same problem,
by explaining how you achieved this?

7 Jun 2008, 5:18 AM
#4
noone avatar

noone

New Zenner

Join Date:
Jun 2008
Location:
Utah, US.
Posts:
26
Plugin Contributions:
0

Re: I need help in stopping "adjust_quantity"

LOL...you asked for it!!...lol
to begin, i am a novice to intermediate lamp programmer, and i have not yet had time to truly test my results, however, my initial test of adding the same item + attributes + different front and back image uploads seems to be successful as they all listed as separate products with different images and all totals were added-totaled correctly, but that is as far as i have gotten. I have not attempted a full checkout test.

what i did is as follows:

includes/classes/shopping_cart.php

line: 256

changed:
$qty = $this->adjust_quantity($qty, $products_id, 'shopping_cart');

if ($this->in_cart($products_id)) {
  $this->update_quantity($products_id, $qty, $attributes);
} else {
  $this->contents[] = array($products_id);
  $this->contents[$products_id] = array('qty' => (float)$qty);

Into:
//$qty = $this->adjust_quantity($qty, $products_id, 'shopping_cart');

//if ($this->in_cart($products_id)) {
 // $this->update_quantity($products_id, $qty, $attributes);

// } else {
$this->contents[] = array($products_id);
$this->contents[$products_id] = array('qty' => (float)$qty);

my attempt was to kill the "auto product adjustment" of same $product_id.

This could be the answer to my dreams, or i may have totally broken my cart.
FOLLOW ME AT YOUR OWN PERIL!!!.....lol

Misty, i hope this is usefull, and i will get back here soon with my results.

NooNe.

7 Jun 2008, 5:22 AM
#5
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: I need help in stopping "adjust_quantity"

Misty, i hope this is usefull, and i will get back here soon with my results.
Excellent, BUT obviously you need to confirm that code changes
to indeed solve problem.
:smile:

7 Jun 2008, 3:12 PM
#6
noone avatar

noone

New Zenner

Join Date:
Jun 2008
Location:
Utah, US.
Posts:
26
Plugin Contributions:
0

Re: I need help in stopping "adjust_quantity"

Misty (and all others), i have completed a full checkout, and all went well.
The orders were added - totaled and processed through PayPal with no problems.
and the orders are displayed as expected in: My Account, Account history, customer notification email, admin new purchase email, and admin new orders.

The multiple orders were separated as hoped, and not seen by the cart as ordering more of the same, success.

NooNe

7 Jun 2008, 3:51 PM
#7
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: I need help in stopping "adjust_quantity"

Thanks for confirming that your coding solution
worked to solve problem
:clap: