Totally Zenned
- Join Date:
- May 2005
- Location:
- Bath, Somerset
- Posts:
- 1,054
- Plugin Contributions:
- 2
[Done v1.3.9] Quantity Discounts Don't Apply with PHP 5.2.5
The bug can be re-created following these steps:
- Run your store using PHP 5.2.5
- Set up a product with attrbiutes
- Set up a product with Quantity Group Discounts eg 1-2 $100 : 3-10 $50.00
- Allow the products to mix attribute quantities when applying the discounts.
- Order a mixed selection of products.
The bug results in the first group of products ordered being full price, when buying 1 or 2 products. If you then add enough products to go over the threshold, the original products added to cart remain at full price, and the next set are shown at reduced price.
FIX:
includes/classes/shopping_cart.php - function get_products()
LINE 1059-1060
Replace
reset($this->contents);
while (list($products_id, ) = each($this->contents)) {
with
reset($this->contents);
$tmp_cart_contents = $this->contents;
while (list($products_id, ) = each($tmp_cart_contents)) {
I think the reason for this bug is the inclusion of the function zen_get_products_discount_price_qty which also iterates through the $this->contents variable.
Hope this helps,
Absolute
Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store