Change the order in which coupons are applied

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
ntnsapre
Posts: 21
Joined: 16 Jan 2018, 20:31

Change the order in which coupons are applied

Post by ntnsapre » 03 Mar 2018, 07:09

If I have two coupons, one a PercentRebate and the other FixedRebate. Is there a way to force the order - such that the PercentRebate is always applied first, followed by the FixedRebate? At the moment, no matter what order I apply the coupons, the FixedRebate is applied first, followed by the PercentRebate.

---------------

Aimeos version: 2017.10
PHP version: 7.1
Package: Laravel 5.5
Environment: Linux

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Change the order in which coupons are applied

Post by aimeos » 03 Mar 2018, 17:44

Hm, according to the code, the coupons should be applied in the order they are added to the basket:

Add: https://github.com/aimeos/aimeos-core/b ... e.php#L484

Update: https://github.com/aimeos/aimeos-core/b ... on.php#L71

Their order is never change and the associative array keeps the order
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

ntnsapre
Posts: 21
Joined: 16 Jan 2018, 20:31

Re: Change the order in which coupons are applied

Post by ntnsapre » 04 Mar 2018, 04:02

Please see attached. If the 20% Discount is applied first, and the 100 USD rebate second, the total should be 1100 and the total discount should be 400.
Attachments
scr.png
scr.png (13.93 KiB) Viewed 2242 times

ntnsapre
Posts: 21
Joined: 16 Jan 2018, 20:31

Re: Change the order in which coupons are applied

Post by ntnsapre » 04 Mar 2018, 12:37

Is there any other information you need?

User avatar
aimeos
Administrator
Posts: 7836
Joined: 01 Jan 1970, 00:00

Re: Change the order in which coupons are applied

Post by aimeos » 04 Mar 2018, 17:25

That change fixed the problem for us:
https://github.com/aimeos/aimeos-core/c ... 44615852f5
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

ntnsapre
Posts: 21
Joined: 16 Jan 2018, 20:31

Re: Change the order in which coupons are applied

Post by ntnsapre » 05 Mar 2018, 03:28

Yes, it has been fixed, thank you very much! :-)

Post Reply