I have a Drupal Commerce product with two variations.

  • Variation A - 18 euro - SKU 123
  • Variation B - 30 euro - SKU 234

Is it possible to apply a promotion only on Variation B?

I am using Drupal Commerce 8.x-2.4.


You need to implement you own promotion condition plugin. Theres a condition plugin defined in commerce_product module in Commerce module since 2.0 release but I recommend you to use latest stable release. Check this class Drupal\commerce_product\Plugin\Commerce\Condition\OrderItemVariationType thus it only checks for variation type (aka bundle), you can easily write your own checking specific product variation instance. Also worth checking OrderItemProduct condition plugin I think you need a mix from both. This plugin is located in the same namespace than the first one.


There's a feature request for that see this link. Thanks to @bojanz!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.