getEligibleTriggers( )

Retrieves eligible custom discount triggers based on the provided items. The retrieved custom triggers are based on your own business logic.

The getEligibleTriggers() function determines whether a cart or checkout's items meet the conditions for a discount to apply to an item. The function is automatically called by Wix eCommerce when actions are performed on the cart or checkout entities/pages. For example, when adding an item to the cart.

Where to find getEligibleTriggers()

When you add the Custom Discount Trigger plugin, a folder is automatically added to your site. Use the .js file in the folder to write the code to retrieve custom triggers. For more information on setting up your custom triggers, see Tutorial: Custom Discount Trigger Service Plugin.

Method Declaration
Copy
Method Parameters
optionsOptionsRequired

Line items and triggers.


contextContextRequired

Metadata about the request.

Returns
Return Type:Promise<EligibleTriggers>
Was this helpful?
Yes
No