03 Jun 2011, 04:47
#1
Totally Zenned
- Join Date:
- Apr 2007
- Location:
- Vancouver, Canada
- Posts:
- 1,566
- Plugin Contributions:
- 47
Auto Update Max Quantity Bug
Say a product has a max of 3. If you add 50 to the cart, it will auto adjust to 3, this is correct. However, if you then try to change it to 2, it'll become 3 again and show the error.
This is happening because of this line of code in includes/classes/shopping_cart.php around line 1560:
if (($new_qty + $cart_qty > $add_max) and $add_max != 0) {
$adjust_max= 'true';
$new_qty = $add_max - $cart_qty;
}
Should it not just be:
if (($new_qty > $add_max) and $add_max != 0) {
$adjust_max= 'true';
$new_qty = $add_max;
}