If this is your first visit, check our documentation. To post, register or login.
Forums / Code Matters / Bug Reports / Discount Qty Applies to Mixed Attributes doesn't work

Discount Qty Applies to Mixed Attributes doesn't work

Started by siliconbug on 18 Sep 2024, 1:46 AM · Views: 1,781

Results 1 to 4 of 4
18 Sep 2024, 1:46 AM
#1
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
126
Plugin Contributions:
0

Discount Qty Applies to Mixed Attributes doesn't work

Just noticed the "Discount Qty Applies to Mixed Attributes" function doesn't work in v1.5.8a

Either "Yes" or "No" gives me the same incorrect result (no discount qty applied). I tested with PHP 7.4 and 8.0, but still didn't get the correct amount. Is there any possible setting conflict?

Attachment 20754

18 Sep 2024, 10:13 AM
#2
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Discount Qty Applies to Mixed Attributes doesn't work

This works in master. Not sure if it was fixed in 2.0.x or 2.1.0.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

18 Sep 2024, 10:41 AM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,760
Plugin Contributions:
56

Re: Discount Qty Applies to Mixed Attributes doesn't work

Looks good in 2.0.1 as well.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

22 Sep 2024, 4:04 AM
#4
siliconbug avatar

siliconbug

Zen Follower

Join Date:
Apr 2009
Posts:
126
Plugin Contributions:
0

Re: Discount Qty Applies to Mixed Attributes doesn't work

It looks like a similar issue from https://www.zen-cart.com/showthread.php?230034-Products-Price-Manager-discounts-aren-t-working-on-multiple-attributes-even-though-th

So I copy the following codes (from v2.0.1) to \includes\functions\functions_price.php and insert between line 1417 and 1418:

if (IS_ADMIN_FLAG === false) {
$new_qty = $_SESSION['cart']->in_cart_mixed_discount_quantity($product_id);
// check for discount qty mix
if ($new_qty > $check_qty) {
$check_qty = $new_qty;
}
}

So far it works fine, and no error logs generated.
I would appreciate it if anyone could look into and verify my modification.