Total amount is affected by the order of the products in the cart

  • Posts: 223
  • Thank you received: 26
  • Hikashop Business
1 year 5 months ago #345917

-- HikaShop version -- : 4.6.2
-- Joomla version -- : 3.10.11
-- PHP version -- : 7.4.26 & 7.4.32

Hi,
Total amount is affected by the order of the products in the cart, when products have a discount.
I have Product 3 with a discount of -25%.
I have a coupon with a discount of -30% with Auto load in cart if possible when Product 1, Product 2, Product 3 are in cart, Coupon handling of discounted products: Override discounted products , and the coupon applies only for this 3.
The problem I have, is that the price change if Product 3 it is added last in the cart.

Thank you!

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81504
  • Thank you received: 13064
  • MODERATOR
1 year 5 months ago #345929

Hi,

Thank you for the feedback and the details.
I was able to reproduce the issue on my end.
It comes from the check we have to make sure that the coupon amount is not negative when taking into account the discount (if the discount value is bigger than the coupon value, then the coupon amount would be negative with that handling mode).
The problem is that this check is done for each product taken into account instead of being placed after all the products have been taken into account.

I've made a patch which seems to fix the problem on my end. Please download again the install package of the 4.6.2 on our website and install it on yours and you'll get the patch.

The following user(s) said Thank You: oxido

Please Log in or Create an account to join the conversation.

Time to create page: 0.043 seconds
Powered by Kunena Forum