Describe the bug
After fixing this issue: https://github.com/PrestaShop/PrestaShop/issues/11722 in the develop branch.
2 uses cases are not ok in the develop branch as reported here: https://github.com/PrestaShop/PrestaShop/issues/11722#issuecomment-561220896
Issue 1:
Create the following rules:
Rule 1
Amount discount:

Rule 2

Rule 3
Free gift

Cart:

Issue 2:


In the PS1.7.6.2, the total is well calculated
Additional information
PrestaShop version: develop
PHP version: 7.1
I think you need to revert my PR... :-(
If we take the price of the gift with FinalUnitPrice, it works with whatever cartrule amount, but doesnt work for more than 1 gift rule.
If, after the PR we get it with InitialUnitPrice, it works properly, BUT gift rules must go first. Which we unfortunatelly cannot enforce in the code, because user can select both discount and gift in one single cart rule...
With the indicated cart rules configuration above and in branch develop, the issues are not reproducible:
1st issue:

2nd issue:

Thanks to everyone
Another issue.
Create 2 Free shipping rules. Total is correct but discount amount doesn't.

I confirm the issue mentioned by @idnovate concerning multiple free shippings.

Questions:
-10 in the scenario instead of -20?-0.00$ instead of free shipping ?Thanks in advance.
- Should the total discounts be
-10in the scenario instead of-20?
YES
- Do you have in develop
-0.00$instead offree shipping?
The screenshot was not in last PS version which fixed this issue ;)
Hi @arouiadib, @idnovate,
About this issue: https://github.com/PrestaShop/PrestaShop/issues/16673#issuecomment-570175986
With PS1.7.0.0(develop branch) => Issue is fixed:


Thanks!
Ok @idnovate , makes sense. Thank you.
@khouloudbelguith , could you please make a test when there is no carrier with free shipping? Just make sure the carriers have the status "free shipping" disabled.
Because I feel that, @idnovate and me, are performing tests when there are no free shipping carriers, or at least with products configured without free shipping.
Again thank you very much for your time.
@arouiadib, thanks for these clarifications.
Create 2
Free shippingrules. Total is correct but discount amount doesn't.
Yes, you are right to reproduce the issue we should have no carrier with free shipping with develop branch.
https://drive.google.com/file/d/15_C65TxgG5dMlV9SCfbnn3gBoInbXXJT/view
Ping @atomiix, this issue is fixed with this PR: https://github.com/PrestaShop/PrestaShop/pull/16724?
Thanks!
Hi @khouloudbelguith ,
After merging @atomiix PR: #16724 with develop in localhost, I found that it doesn't include the solution to the latter problem mentioned by @idnovate (which is maybe not the aim of that PR).
Anyways, what if we close this issue and create a separate one for multiple free shipping rules? I think it will make things clearer because this current issue is fixed with or without #16724 (and already closed here #11722).
Thank you very much for your time.
Regards,