Which SKU should a Magento 2 variant discount use?

1 min read

Olive knitwear in a box with two different-sized paper tags

A shopper chooses SHIRT-RED, but the coupon gives no discount from the SHIRT-RED entry. Check the SKU on the line that reaches the rule.

Configure one rule and two variants

Choose an active coupon rule in Discount Rule per Product. Set up SHIRT and two variants at PLN 100 each. Test one unit with TEST15 in the same store view. Activate one 15% entry at a time for the parent SKU or SHIRT-RED, then recalculate the basket.

Compare the lookup and the line discount

In the isolated 1.0.59 test, the rule received the parent line. The current SKU could show the variant and the original product SKU was SHIRT. The extension used the original SKU to find an active entry in the store scope.

Amount set by the extension in PLN
CaseEntry SKUSelected variantSKU queriedDiscount
Parent with redSHIRTSHIRT-REDSHIRT15
Parent with blueSHIRTSHIRT-BLUESHIRT15
Variant entry with redSHIRT-REDSHIRT-REDSHIRT0
Variant entry with blueSHIRT-REDSHIRT-BLUESHIRT0

SHIRT produced PLN 15 in both cases. SHIRT-RED did not match the key looked up. The table shows the amount handed over to the native validator. Per-SKU discount documentation

Check the key on the processed line

If the rule processes the parent line, check its catalogue SKU and the scope of the active entry. Test both variants and check the final recalculated basket discount. Where other offers apply, read the rule IDs too. Guide to overlapping discounts

Previous Next

KOWAL.BLOG

Choose your language

Available versions open the corresponding page. More languages are being prepared.

English (UK) Français Deutsch Español Italiano Português Nederlands Svenska Dansk Norsk Suomi Lietuvių Latviešu Eesti Čeština Slovenčina Magyar Română Български Ελληνικά Slovenščina Hrvatski Polski English (US)