Skip to content
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

Coupon codes with a "total price of items from taxon" rule works badly #16303

Open
coldic3 opened this issue May 23, 2024 · 1 comment
Open
Labels
Bug Confirmed bugs or bugfixes.

Comments

@coldic3
Copy link
Contributor

coldic3 commented May 23, 2024

Sylius version affected: 1.12, 1.13

Description
The rule "total price of items from taxon" so the checker Sylius\Component\Core\Promotion\Checker\Rule\TotalOfItemsFromTaxonRuleChecker wrongly checks whether the promotion is eligible or not. It sums up the order items total but if the coupon is already applied and decreased items total then the rule starts denying the coupon and you cannot go to the checkout.

Steps to reproduce
Let's have the cart promotion configured as follows:
image

And let's say the product variant in the taxon costs €20.38.

Now let's add 3 of them to the cart and apply this coupon code. All works as expected:
image

But now if I try to go to the checkout, I can't. It happens because coupon validation is triggered for a second time and the rule is not met anymore.
image

Possible Solution

  • Consider the order of order processors.
  • Calculate the sum of order items based on variant price rather than the order item total.
@TheMilek
Copy link
Member

Hi @coldic3! 💃🏽

Thank you for raising the issue. 🏅
We reproduced it, and it seems to be a bug.
Could you please open a PR with a solution or at least create a scenario that describes the problem so we can take it over?

Thanks in advance! 🚀

@TheMilek TheMilek added the Bug Confirmed bugs or bugfixes. label May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed bugs or bugfixes.
Projects
None yet
Development

No branches or pull requests

2 participants