Skip to main content

Creating a discount

Fetching a discount

The following scopes are available:

Resetting the discount cache

For performance reasons the applicable discounts are cached per request. If you need to reset this cache (for example after adding a discount code) you should call resetDiscounts():

Discount Purchasable

You can relate a purchasable to a discount via this model. Each has a type for whether it’s a condition or reward.
  • condition - If your discount requires these purchasable models to be in the cart to activate
  • reward - Once the conditions are met, discount one of more of these purchasable models.

Relationships

  • Purchasables discount_purchasables
  • Users - customer_user

Adding your own Discount type