Introduction
Note: This service plugin is currently in beta and is subject to change.
The eCommerce Custom Discount Triggers service plugin (formerly SPI) allows you to provide custom triggers that specify when an item can be discounted.
Custom triggers play a part in the definition of discount rules - sets of triggers and scopes that together define the necessary conditions for a discount to apply to items in the cart/checkout.
Before you begin
To use a custom trigger:
- Provide your custom triggers by implementing the
listTriggers()
function. - Implement the
getEligibleTriggers()
and provide the logic needed for applying the relevant custom triggers. - Create an automatic discount using the dashboard, or by using the Discount Rules API.
To add a service plugin
- Add the plugin to your site.
- Update the
getConfig()
function in the -config.js file that is added to your site during step 1. - Update the
listTriggers()
andgetEligibleTriggers()
functions in the .js file that is added to your site during step 1.
Was this helpful?
Yes
No