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 callresetDiscounts():
Discount Purchasable
You can relate a purchasable to a discount via this model. Each has a type for whether it’s acondition or reward.
condition- If your discount requires these purchasable models to be in the cart to activatereward- Once the conditions are met, discount one of more of these purchasable models.
Relationships
- Purchasables
discount_purchasables - Users -
customer_user