-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong cart items total if promotion on units #11585
Comments
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions. |
Do not stale please |
Hi, Please consider this as a bug. Bug is on the getSubtotal() method on OrderItem. The problem is that getDiscountedUnitPrice() only retrieve discounted price from the first orderItem unit. I encountered same issue with a new custom type of promotion "percentage discount on the Nth cheapest article". Sylius version affected Possible solution |
This PR was merged into the 1.11 branch. Discussion ---------- | Q | A | |-----------------|--------------------------------------------------------------| | Branch? | 1.11 | Bug fix? | yes | | New feature? | no | | Related tickets | replace #13986, fixes #13532 and #11585 | | License | MIT | <!-- - Bug fixes must be submitted against the 1.10 or 1.11 branch(the lowest possible) - Features and deprecations must be submitted against the master branch - Make sure that the correct base branch is set To be sure you are not breaking any Backward Compatibilities, check the documentation: https://docs.sylius.com/en/latest/book/organization/backward-compatibility-promise.html --> We also should add here behat scenario, but TBH, I don't know how to prepare proper background Commits ------- 37ab500 Calculate order item subtotal as the sum of units discounted price b987eee Small refactor of orderItemSubTotal
Sylius version affected: 1.7 for sure, and I believe all previous as well
Description
We have a cart composed of 3 quantities of 1 product, $100 each.
If we apply a promotion of 100 split among those units, we will have
Everything is good from amount perspective, but in the cart summary, we end up having something like this :
The Order total is right, but since each
Beige Strappy summer dress
costs$71.40
, the items total is wrong.In fact, those
Beige Strappy summer dress
costs$71.40
,$71.39
and$71.39
Steps to reproduce
Apply a different promotion to first unit of an order item with multiple units and go to cart page.
Possible Solution
This has something to do with the way item total and itemsTotal are calculated.
The text was updated successfully, but these errors were encountered: