Skip to content

Context Rules and Rule Systems

You are viewing an outdated version of the documentation.
Click here to switch to the stable version (v6.6), or use the version switcher on the left to navigate between versions.

Context Rules and Rule Systems

  • In a rule, there must never be a query against the database because all configured rules are validated in a request.
  • Rules that check for the cart must always support the \Shopware\Core\Checkout\Cart\Rule\CartRuleScope class and the \Shopware\Core\Checkout\Cart\Rule\LineItemScopeclass.
  • Rules may only access data provided in the appropriate scopes.