[Skip to main content](#vessel-content)

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

##

- **[oxido](/forum/user/29793-oxido "View oxido's Profile")**
- [![oxido's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/29793-oxido "View oxido's Profile") Topic Author
- [ Offline](/forum/user/29793-oxido)

Less More

- Posts: 285
- Thank you received: 42
-
-

4 years 3 weeks ago [\#345917](#345917) by [oxido](/forum/user/29793-oxido "View oxido's Profile")  *[Total amount is affected by the order of the products in the cart](/forum/46-discount-coupon/905229-total-amount-is-affected-by-the-order-of-the-products-in-the-cart#345917 "-- HikaShop version -- : 4.6.2 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.26 &amp; 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!")* was created by *[oxido](/forum/user/29793-oxido "View oxido's Profile")*

-- HikaShop version -- : 4.6.2
-- Joomla version -- : 3.10.11
-- PHP version -- : 7.4.26 &amp; 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!

- [ ![1-3-2.jpg](/forum/attachment/55766) ](/forum/attachment/55766 "1-3-2.jpg") [ ](/forum/attachment/55766?download=1 "1-3-2.jpg")
- [ ![1-2-3.jpg](/forum/attachment/55767) ](/forum/attachment/55767 "1-2-3.jpg") [ ](/forum/attachment/55767?download=1 "1-2-3.jpg")
- [ ![discount.jpg](/forum/attachment/55768) ](/forum/attachment/55768 "discount.jpg") [ ](/forum/attachment/55768?download=1 "discount.jpg")
- [ ![coupon.jpg](/forum/attachment/55769) ](/forum/attachment/55769 "coupon.jpg") [ ](/forum/attachment/55769?download=1 "coupon.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi85MDUyMjktdG90YWwtYW1vdW50LWlzLWFmZmVjdGVkLWJ5LXRoZS1vcmRlci1vZi10aGUtcHJvZHVjdHMtaW4tdGhlLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86556
- Thank you received: 14304
-
-

4 years 3 weeks ago [\#345929](#345929) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Total amount is affected by the order of the products in the cart](/forum/46-discount-coupon/905229-total-amount-is-affected-by-the-order-of-the-products-in-the-cart#345929 "-- HikaShop version -- : 4.6.2 -- Joomla version -- : 3.10.11 -- PHP version -- : 7.4.26 &amp; 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!")*

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](/forum/user/29793-oxido "View oxido's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi85MDUyMjktdG90YWwtYW1vdW50LWlzLWFmZmVjdGVkLWJ5LXRoZS1vcmRlci1vZi10aGUtcHJvZHVjdHMtaW4tdGhlLWNhcnQ/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.054 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
