docs

Advanced Automatic Discounts

Set up Advanced Automatic Discounts via the SCAYLE Panel when you need more complex and granular conditions than the standard Automatic Discounts flow supports.

Introduction to Advanced Discounts

Advanced Discounts allow you to define more complex and granular conditions for Automatic Discounts, Buy X Get Y, and Combo Deals. These configurations help tailor promotions to specific customer behaviors or product attributes.

When setting up advanced discounts, consider where the conditions should apply:

Item Conditions: Conditions that apply to items. Example: Only apply a discount to items that are red or belong to a specific product attribute group.

Global Conditions: Apply to the entire basket or customer context. Example: The basket must contain at least 3 items from a specific brand.

You can use these condition types in combination to build precise and effective promotions.

Condition Definition

Conditions (both global and Item conditions) are defined using Google Common Expression Language (CEL). SCAYLE’s implementation is based on Go (cel-go) with the Math extension (math.greatest(), math.least()) and an additional sum() function.

Note: Attributes on payload.customer.* are only validated in Checkout (not in the Storefront). If you want to evaluate customer conditions early, use the audiences feature.

Examples of cell-go and Math extension expressions




Note that prices are expressed in euro cents, not euros

The following condition checks if the current item has a brand attribute and excludes items that match specific brand IDs:

Available Condition Parameters

The following table lists the parameters available in CEL conditions.

ParameterTypeDescription
item.price.withTax / item.price.withoutTaxIntegerItem unit price in cents, including or excluding tax.
item.totalPrice.withTax / item.totalPrice.withoutTaxIntegerTotal item price (unit price × quantity) in cents, including or excluding tax.
item.quantityIntegerQuantity of the item in the basket.
item.product.masterCategoryIdIntegerMaster category ID of the product.
item.product.shopCategoryIdsList<Integer>Shop category IDs the product belongs to. Use in to check membership.
item.product.attributes['<key>']List<Integer>Product attribute values by key (list of attribute value IDs). Always check existence with has(item.product.attributes.<key>) before accessing.
item.variant.attributes['<key>']List<Integer>Variant attribute values by key (list of attribute value IDs). Always check existence with has(item.variant.attributes.<key>) before accessing.
payload.itemsListAll items in the basket. Use for global conditions that evaluate the entire basket context.
payload.customer.*ObjectCustomer context attributes. Only evaluated in Checkout, not in the Storefront.

Condition template:

To include items with a specific attribute value:

To exclude items with specific attribute values (using the ! operator):

Create a new Advanced Automatic Discount

  1. Select the Shop where you want to create your promotion and go to Promotions ➜ Advanced Promotion
  2. Click the + New Advanced Promotion button.
  3. In the Name field, type a name for the promotion (visible internally only).
  4. Select a Promotion type: Automatic Discount, Buy X Get Y, Combo Deal, or Free shipping. You can choose only one type. This guide covers Automatic Discount.
  5. Enter a whole number in the Priority field. SCAYLE does not evaluate this value itself; it passes it on to your shop, which decides how to use it, for example lower numbers first, higher numbers first, or not at all. If you're unsure how your shop uses it, check with your development team.
  6. In the Display Name field, type the name of the promotion that will be shown to the customer during the Checkout Process. It can also be used on email templates and Invoices.
  7. Select a Start date and End date.
  8. In Countries, select in which countries of the current shop the promotion should be valid.
  9. In Audiences, select for which customer audience the promotion should be valid.
  10. In Customer segments, select customers you want to allow or block from this promotion.
  11. Select whether the promotion should be combinable with other promotions.
  12. Under Automatic Discount you are choosing what the user gets, and you can choose between Automatic Discount or Tiered Discount templates.
    Automatic Discount preview
    1. The Automatic Discount template allows you to give a Percentage, Absolute or Free shipping.
      1. Tiered Discount allows you to give Percentage or Absolute Discounts based on basket minimum order value (MOV) tiers.
        Tiered Automatic Discount preview
    2. For Percentage or Absolute Discounts you can choose to distribute the values pro rata.
    3. For Free shipping you can also choose to give Free shipping only for certain (or all) carriers.
  13. Add at least one Condition to the promotion - this is the equivalent of Customer Buys.
  14. Finally you can enable the toggle Promotion Design if you want to change the visual appearance of the promotion and localize it.
    Promotion Design toggle and preview 1
    Promotion Design toggle and preview 2
    1. You can check how your promotion looks in the preview on the right-hand side.
      Promotion Design preview
  15. Click Create.

On the right side you can see a nifty summary of all your promotion is doing.

Editing or Deactivating an Advanced Automatic Discount

  1. Select the Shop where you want to edit your promotion and go to Promotions ➜ Advanced Promotion.
  2. Select an already created Promotion.
  3. Click the Edit button.
  4. Update the rules as needed, or set Status to Inactive to deactivate the promotion by setting Status ➜ Inactive.
  5. Click save.