SalesChannel
, CustomerGroup
, ...) and the current state (LineItems
, Amount
, ...), but user controlled and decoupled from the cart itself. In theory every part of Shopware 6 can contribute to the set of available rules.If a customer orders a car, a pair of sunglasses in the same order will be free.
car
is in the cart) to point b (sunglasses
are free).Rule
, it is realized as a variant of the Specification pattern, but omits the name due to a few key differences.match
instead of isSatisfiedBy
match(RuleScope $scope)
function to validate user defined values against a runtime state. See the following object diagram for a better understanding: