Problems when updating product quantities
I am having a problem in my shopping cart. I have products that have quantity limits set. I can add a product to the cart with out issue. I start to have problems when I try to change the quantities in the shopping cart. I have a max quantity set to 10 items. If I only have a quantity of 1 in the cart and want to change it to 2, I have no problem. However, if I have 1 and want to change to 10, I get the message that I have exceeded my limit. It acts like it is adding the previous value and the changed value to determine if I am exceeding my quantity limit. You can view my site at: www.crappietomtackle.com/shop
Re: Problems when updating product quantities
If you edit the file:
/includes/classes/shopping_cart.php
and change the code around line 1557 to read:
Code:
// adjust quantity if needed
if ($new_qty > $add_max) {
if (($new_qty + $cart_qty > $add_max) and $add_max != 0) {
$adjust_max= 'true';
$new_qty = $add_max - $cart_qty;
}
}
does this fix the problem?
Re: Problems when updating product quantities
That did indeed fix the problem. Thanks for the quick assistance.
Re: Problems when updating product quantities
Thank you for confirming that this was able to fix the Maximum Value issue that you were having with the update quantity ...
Re: Problems when updating product quantities
What version is this one?
Re: Problems when updating product quantities
I believe this is a problem in v1.3.9e and v1.3.9f ...
The quantity added to your cart has been adjusted because of a restriction on max
seeing this error in 1.3.9e:
shopping cart page:
Quote:
The quantity added to your cart has been adjusted because of a restriction on maximum you are allowed. See this item:
Error triggered by deleting items with checkbox(es) and update cart button on cart page
error on all remaining products that are in cart, that are:
Product Qty Minimum: 1
Product Qty Maximum: 1
Product Qty Units: 1
Product Qty Min/Unit Mix: Yes
Products Quantity: 1
*not seeing this error on products that are in cart, that are: :
Product Qty Maximum: *more than 1
Products Quantity: *more than 1
--------
ALSO: Using the trash can icon to delete (not the checkbox/update cart) does not trigger this error.
Re: The quantity added to your cart has been adjusted because of a restriction on max
This is fixed in v1.3.9f ...
Code:
//die('I see Update Cart: ' . $_POST['products_id'][$i] . ' add qty: ' . $add_max . ' - cart qty: ' . $cart_qty . ' - newqty: ' . $new_qty);
if (($add_max == 1 and $cart_qty == 1)) {
// do not add
$adjust_max= 'true';
} else {
// adjust quantity if needed
if ($new_qty > $add_max) {
if (($new_qty + $cart_qty > $add_max) and $add_max != 0) {
$adjust_max= 'true';
$new_qty = $add_max - $cart_qty;
}
}
$attributes = ($_POST['id'][$_POST['products_id'][$i]]) ? $_POST['id'][$_POST['products_id'][$i]] : '';
$this->add_cart($_POST['products_id'][$i], $new_qty, $attributes, false);
}
if ($adjust_max == 'true') {
Re: [DONE v1.3.9f] The quantity added to your cart has been adjusted because of a res
Hi Linda!
I tried that fix before posting in includes/classes/shopping_cart.php but it had no effect.
Re: [DONE v1.3.9f] The quantity added to your cart has been adjusted because of a res
I just tried using the includes/classes/shopping_cart.php from 1.3.8f still no effect (the only change from 1.3.9e to f is the breadcrumb fix)
I then dialed back to 1.3.9d's includes/classes/shopping_cart.php and do not see the errors.
Must have something to do with these doohickies (added lines from d to e/f):
Line 1535-1537:
PHP Code:
if ($_POST['cart_quantity'][$i] == '') {
$_POST['cart_quantity'][$i] = 0;
}
and Line 1546:
PHP Code:
$cart_qty = $this->in_cart_mixed($_POST['products_id'][$i]);
Should I just take those bad boys out?:unsure: