Discount value not properly calculated when non-discounted item added to cart
I could use some expert help, please
ZC156c
php 7.3.20
maria 10.3.23
plugins that I think may affect price calculations:
Dynamic Price Updater
Quantity Discounts
OPC
Discount coupon setup (admin:discounts:coupon admin)
Deny ALL
Category #1 ALLOW 20% discount
Category #2 ALLOW 20% discount
- When items from either, and/or both categories are in cart, discount is calculated correctly
- IF an item from a 'non-discounted' category is added to cart, discount is calculated correctly
- WHEN the quantity of that same 'non-discounted' item is increased to satisfy a Quantity Discount, the discount coupon value shown at checkout changes, ie: is reduced by a value that I have not yet associated with anything.
I do not recall zc154 never having this issue and we use similar discount/coupon structures frequently. This just happens to be the first since upgrading to 156c
Order Total: in sort order
ot_quantity discount
ot_subtotal
ot_shipping
ot_coupon
ot_group pricing
ot_tax
ot_loworderfee
ot_gv
total
In my example
product 1: $32.24 discounted 20%
product 2: $134.46 discounted 20%
product 3: $213.15 quantity discounted 5%
coupon discount should be $33.34
quantity discount should be $10.66
coupon discount changes to $31.08 when product 3 (qty 5) is in cart
coupon discount shown correctly is $33.34 when product 3 (qty 4 or less) is in cart
Re: Discount value not properly calculated when non-discounted item added to cart
What happens if the quantity_discount module is in some way placed below the coupon order total module?
Fyi, Dynamic Price Updater does not offer any "changes" beyond the display of information on the PRODUCT_TYPE_info page and even then it is for display only without any actual change to the cart or what it or the order total modules calculate upon/in checkout. It may help "reveal" information about the end price, but doesn't modify it.
Obviously would also suggest running through a "checkout" with OPC temporarily disabled to likely show that it doesn't have an effect.
My guess is that between the calculated discount and the customer's price that some aspect of that is modifying the values seen in the coupon order total module against which to apply the discount and that it is in essence reducing the amount of money to come off because of that... Haven't run the "numbers" though. I would think that the test above may reveal that "fact" or issue and from there a solution that continues to support "the old way" can be determined even if it is a special or one-off solution.
Re: Discount value not properly calculated when non-discounted item added to cart
Quote:
Originally Posted by
mc12345678
What happens if the quantity_discount module is in some way placed below the coupon order total module?
My guess is that between the calculated discount and the customer's price that some aspect of that is modifying the values seen in the coupon order total module against which to apply the discount and that it is in essence reducing the amount of money to come off because of that... Haven't run the "numbers" though. I would think that the test above may reveal that "fact" or issue and from there a solution that continues to support "the old way" can be determined even if it is a special or one-off solution.
Calculations seem to be correct if ot_quantity discount is applied after ot_coupon.
Since ot_quantity code hasn't changed and you seem to say the zc core has a 'new way' of doing things, then the new way of doing things must have had a bug introduced.
Product with qty discounts are completely unrelated to coupon discounts so that makes no sense to me.
Re: Discount value not properly calculated when non-discounted item added to cart
I understand that bugs happen and they cant be squished if no one knows they exist. :smile: