fix: check if # rule matches with coupon code #44104
Open
+10
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
There are two coupon codes, each with distinct # rules:
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 # rule is also incorrectly applied, as it matches the second item (because it is in the item group).
Changes
Update the check in
get_#_rule_for_item
and check whether the current # rule matches the specified voucher code.Backports
version-14
version-15
Issue
closes #40013
Images
Winter2024 Coupon Code and # Rule:
Karneval2024 Coupon Code and # Rule:
Added Karneval2024 Coupon Code to Sales Order, both Items discounted: