> Portal Navigation: > > - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version. > - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages). > - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`). > - Top-level index of all portals: https://dev.wix.com/docs/llms.txt > - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt ## Resource: Service Plugins ## Namespace: ecom-custom-discount-triggers ## Article: Introduction ## Article Link: https://dev.wix.com/docs/velo/events-service-plugins/e-commerce/service-plugins/ecom-custom-discount-triggers/introduction.md ## Article Content: # 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()`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-custom-discount-triggers/listtriggers) function. + Implement the [`getEligibleTriggers()`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-custom-discount-triggers/geteligibletriggers) and provide the logic needed for applying the relevant custom triggers. + [Create an automatic discount using the dashboard](https://support.wix.com/en/article/wix-stores-creating-automatic-discounts), or by using the [Discount Rules API](https://www.wix.com/velo/reference/wix-ecom-backend/discountrules/creatediscountrule). Learn more: + [Velo: Custom App Extensions Using Service Plugins](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/integrations/service-plugins-formerly-spis/custom-app-extensions-using-spis.md) + [Tutorial: Custom Discount Trigger Service Plugin](https://dev.wix.com/docs/develop-websites/articles/code-tutorials/wix-e-commerce-stores/tutorial-custom-discount-trigger-service-plugin.md) ### To add a service plugin 1. [Add the plugin to your site](https://dev.wix.com/docs/develop-websites/articles/coding-with-velo/integrations/custom-extensions-spis/custom-app-extensions-using-sp-is.md#step-1-create-a-new-extension-on-your-wix-site). 2. Update the [`getConfig()`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-custom-discount-triggers/getconfig) function in the **-config.js** file that is added to your site during step 1. 3. Update the [`listTriggers()`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-custom-discount-triggers/listtriggers) and [`getEligibleTriggers()`](https://www.wix.com/velo/reference/spis/wix-ecom/ecom-custom-discount-triggers/geteligibletriggers) functions in the **.js** file that is added to your site during step 1.