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

fix: check if pricing rule matches with coupon code #44104

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

nikolas-beckel
Copy link

Summary

There are two coupon codes, each with distinct pricing rules:

  1. Karneval2024: Discounts a specific item (20%, Item Code 003).
  2. Winter2024: Discounts items from a specific item group (50%, Item Group "Accessoire").

In a sales order, two items are added. The first item belongs to the item group eligible for a discount from Winter2024, while the second item is the specific item eligible for a discount through Karneval2024.

When I apply Karneval2024 in the sales order to discount only the specific item, Winter2024 pricing rule is also incorrectly applied, as it matches the second item (because it is in the item group).

Changes

Update the check in get_pricing_rule_for_item and check whether the current pricing rule matches the specified voucher code.

Backports

version-14
version-15

Issue

closes #40013

Images

Winter2024 Coupon Code and Pricing Rule:
image
image

Karneval2024 Coupon Code and Pricing Rule:
image
image

Added Karneval2024 Coupon Code to Sales Order, both Items discounted:
image
image

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Nov 12, 2024
@ruthra-kumar ruthra-kumar removed the request for review from deepeshgarg007 November 14, 2024 05:59
@ruthra-kumar ruthra-kumar self-assigned this Nov 14, 2024
@nikolas-beckel nikolas-beckel force-pushed the fix-pricing-rule-matches-coupon-code branch from 9dbf9d5 to 64155c2 Compare November 14, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coupon code based pricing rules are auto applied without checking the coupon code entered in sales order
2 participants