Problem/Motivation

Promotion conditions are executed in a consecutive manner. As soon as a condition fails the promotion will not apply. We need to allow a simplistic OR operation.

This should not be overly complex, like Rules, since complex conditions should be implemented as their own condition plugin, anyways.

Proposed resolution

Add buildConfigurationForm method to \Drupal\commerce_promotion\Plugin\Commerce\PromotionCondition\PromotionConditionBase that exposes an "AND" or "OR" operation.

Update \Drupal\commerce_promotion\Entity\Promotion::applies to support conditions which do "OR" and not immediately fail.

Remaining tasks

Do it.

CommentFileSizeAuthor
#4 condition-operator2.png33.71 KBbojanz

Comments

mglaman created an issue. See original summary.

bojanz’s picture

Assigned: Unassigned » bojanz

  • bojanz committed 1df8d68 on 8.x-2.x
    Issue #2796753: Allow conditions to be "OR" instead of strictly "AND"
    
bojanz’s picture

Status: Active » Fixed
StatusFileSize
new33.71 KB

Yay.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.