Cart price rule with condition SKU dosen't take into account the "leading zeros" in the SKU (sku: 01234 is the same as 1234) #37919
Open
Description
Preconditions and environment
Magento ver. 2.4.4
Steps to reproduce
- Create product with SKU: 1234
- Create product with SKU: 01234
- Create CART PRICE RULE (for example):
- Specific coupon
- Coupon code: TESTSKU
- ACTION: percent of product price discount, 50% discount amount)
- Apply the rule only to cart items ... (SKU is 01234)
- Go to shop front and add product SKU 1234 to CART
- On the cart page enter the coupon code TESTSKU
Expected result
Discount for product with SKU: 1234 of 50% should NOT be applied.
Actual result
Discount for product with SKU: 1234 IS applied (even the SKU is not in the CART PRICE RULE CONDITION).
Additional information
It seems that Magento 2 doesn't recognize the leading zeros of SKU.
From our diagnosis it seems that the problem is here:
\Magento\Rule\Model\Condition\AbstractCondition::_compareValues
Release note
No response
Triage and priority
- Severity: S0 - Affects critical data or functionality and leaves users without workaround.
- Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
- Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
- Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
- Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.
Metadata
Assignees
Labels
Type
Projects
Status
Ready for Development