Currently an offer can have multiple conditions but it only checks on an OR, we really need the option for and.

Here is the code for reference:

$offer_conditions = new ConditionGroup($offer->getConditions(), 'OR');

CommentFileSizeAuthor
#3 3045308-3-offer-condition-operator.patch3.09 KBbojanz

Comments

rynnnner created an issue. See original summary.

bojanz’s picture

Title: Promotion Offer Conditions need to have an AND condition. » Allow order item offers to declare their condition operator
Assigned: Unassigned » bojanz
Issue tags: -promotions, -conditions, -offer

Thanks for opening the issue!

OrderItemPromotionOfferInterface has a getConditions() method.
We can introduce a getConditionOperator() method, just like we have on PaymentGatewayInterface and PromotionInterface.

This can then be used by the Promotion and OrderItemQuantity classes, without requiring people to swap both when replacing OR with AND. Plus, it opens the door for a future UI.

bojanz’s picture

Status: Active » Needs review
StatusFileSize
new3.09 KB

Let's try this.

  • bojanz committed 541ac20 on 8.x-2.x
    Issue #3045308 by bojanz: Allow order item offers to declare their...
bojanz’s picture

Status: Needs review » Fixed

Fixed the failing test and committed.

Status: Fixed » Closed (fixed)

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