docs
  1. Promotions
  2. Setting Up Promotions Per Type
  3. Buy X Get Y

Buy X Get Y

Introduction

Buy X Get Y promotions automatically add pre-defined discounts to one or more items to a customer’s basket when specific conditions are met. You can define the rules - such as requiring the purchase of certain products or reaching a minimum order value - to trigger the promotion.

Setting up Basic Buy X Get Y for Basic via SCAYLE Panel

  1. Select the Shop where you want to create your promotion and go to Promotions ➜ Buy X get Y.
  2. Click the + NEW BUY X GET Y button.
  3. In the Name field, type a name for the promotion.
  4. In the Display Name field, type the name of the promotion that will be shown to the customer during the Checkout Process
  5. Priority: enter the priority of the promotion compared to others.
  6. Start date: enter the date and time when the promotion starts running.
  7. End date: enter the date and time when the promotion becomes inactive.
  8. Countries: select which countries that will be eligible for a promotion
  9. Audiences: select audience(s) that will participate on the promotion
  10. Allow promotions to be combined with other promotions on the basket
  11. Select the Customer Buy condition.
    1. Define from which group the customer should Select Items From:
      1. Item Sets: The promotion will be applied in case items from Item Sets are bought
      2. Specific Product: The promotion will be applied in case specific Product IDs are bought
      3. Specific Categories: The promotion will be applied in case items from a specific category are bought
      4. Specific Attributes: The promotion will be applied in case items from a specific attribute are bought
      5. Any product: The promotion will be applied in case any item is bought
    2. Define what is the Minimum Unique Items of a Basket which needs to be bought by the customer
    3. Define what is the quantity logic that will define how many items the customer needs to buy:
      1. Total amount of eligible items: will count how many items are from the selected items of the promotion.
      2. Total amount of unique items: will count how many single unique variant IDs are present in the basket, regardless of the quantity (e.g. promotion will only be applied in case customer buys 2 different variant IDs of the same category)
      3. Total amount of unique items with the same variant ID: will count how many unit items from the same variant ID are present in the basket (e.g. promotion will only be applied in case customer buys 2 items of the same variant IDs within a given category of product)

        Hint: This option is hidden in case the customer selects Items from Item Sets
    4. Quantity: how many items the customer needs to buy for the condition to be applied
    5. Set minimum order amount
  12. Set where the Customer Gets the promotion::
    1. Specific Products: promotion will be applied to specific Product IDs in case the conditions defined on the Customer Buys section are met
    2. Same set of Customer Buys: the promotion will be applied to the cheapest item from the set the customer is buying (e.g. buy 2 T-shirts of a specific brand and get 10% of discount on the 3rd one)
    3. Select the type of discount that will be applied: free, percentage and amount
    4. Select the possibility to apply the discount proportionally to all items that are involved in the promotion. Example: in case there is a promotion of buy 2 T-shirts and get the 3rd one for free, the discount amount can be distributed proportionally amongst the 3 items
    5. Select the maximum number of items the customer can redeem\
  13. Click Create Promotion.

Examples

Here are some examples of how you might create some Buy X Get Y promotions:

Scenario 1: Buy two exact same items from a selected category and get 10% discount on one item.


On the Customer Buys Section, select:

  1. The specific category that will enable the promotion
  2. The amount of items which needs to be bought on the Basket so that the promotion can be valid
  3. As the promotion will only be enabled in case 2 items from the same variant ID will be bought, select the "Total amount of Unique items with the same variant ID" as Quantity Logic
  4. Include the amount of unique items which needs to be bought

On the Customer Buys, select the Discount Type amount and also the possibility of distributing it proportionally between the items that participate in the promotion.

Editing a Buy X Get Y promotion

Edit

  • Select the Shop where you want to edit your promotion and go to Promotions ➜ Buy X get Y.
  • Click the Edit button.
  • Note from here you can update your rules on the same template you used to create it OR
  • Deactivate the discount, for this click on the 3 vertical dots besides Edit and select Deactivate

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

  • Hit save

Deleting a Buy X Get Y promotion

Delete

  • Select the Shop where you want to edit your promotion and go to Promotions ➜ Buy X get Y.
  • Click on the 3 vertical dots besides “Edit” > Delete
  • Confirm on pop up

Setting Basic Buy X Get Y up via Admin API

To create an Buy X Get Y discount using Admin API, see here.

Configure Advanced Buy X Get Y via SCAYLE Panel

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:

This condition can be used to validate if current item is the item with the highest price

This second condition can be used to validate if current item is the item with the lowest price

The following condition will check for a sum of specific brand item totals within a basket (for example 1000 or more euros of NIKE brand within basket)

The following condition will check if the sum of the basket higher than 20 euros

Note that prices are expressed in euro cents, not euros

Create a new Advanced Buy X Get Y

  1. Select the Shop where you want to create your promotion and go to Promotions ➜ Advanced Discount
  2. Click the + Advanced Discount button.
  3. Enter a promotion Name.
  4. Select a Type: Buy X and Get Y.
  5. Select a Start date and End date.
  6. Enter a number for Priority. This determines the priority of the promotion in the case that there are multiple promotions active at the same time.
  7. Select whether the promotion should be combinable with other promotions.
    • If selected, enter Combinable promotion IDs in the Allowlist or Blocklist.
  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. (Optional) In Combinable, select which promotions are allowed or blocked for combination.
  11. In case no Item Sets are used, enter a list of variant IDs the customer can redeem.
  12. Add the Discount Type of the Promotion
  13. Add at least one condition to the promotion.
  14. Click Save.

\