Sample Flows

This article presents sample flows your app can support. You aren't limited to these exact flows, but they can be a helpful jumping off point as you plan your Custom Discount Triggers integration.

Offer a happy hour discount

Your app can allow sites to offer customers a happy hour discount. With a custom trigger based on the time an order is placed, an automatic discount can be applied.

To create a custom trigger for a happy hour discount:

  1. Configure your app with custom triggers that are retrieved by Wix when List Triggers is called. For example, give a custom trigger these properties:
  • "id": "happy-hour-trigger"
  • "name": "Happy Hour, weekdays, 16:00-18:00"
  1. Create a discount rule that includes the amount of the discount to apply, which items to apply the discount to, and which custom trigger to use to trigger the rule.

  2. Wix calls Get Eligible Triggers when actions are taken on the cart or checkout entities/pages. Your app should determine if the time of the customer's action should trigger the Happy Hour discount rule to apply. If so, the customer will see the discounted price.

Offer a sale on digital products

Your app can allow sites to offer discounts on certain types of products, such as, digital products.

To create a custom trigger for a digital discount:

  1. Configure your app with custom triggers that are retrieved by Wix when List Triggers is called. For example, give a custom trigger these properties:
  • "id": "digital-sale-trigger"
  • "name": "Digital products discount"
  1. Create a discount rule that includes the amount of the discount to apply, which category of items to apply the discount to, and which custom trigger to use to trigger the rule.

  2. Wix calls Get Eligible Triggers when actions are taken on the cart or checkout entities/pages. Use Get Product to check the productType and determine if the product a customer views triggers the digital discount rule to apply. If so, the customer will see the discounted price.

Was this helpful?
Yes
No