In order for "Buy X, get Y at discount" or "In cart upsell" campaign to work, you need to do setup automatic discount on Shopify. There are couple benefits of this approach:

  1. App doesn't need to create dynamic coupon codes for you.
  2. All regular card edge cases will be handled by Shopify as a part of automatic discount. If you are using other types of cart, this is added advantage as they are incompatible with most carts.
  3. Shopify has restriction around automatic discounts. It is only possible to have one active automatic discount code at any given time. The reason being is customers cannot apply more than one discount code for an order and automatic discounts take precedence over regular discount codes. Something to remember is that you can have multiple active discount codes but customers can only apply one per order. So it makes sense for merchant to hold all logic and ownership. of it.

Creating an automatic discount code is easy! Here's what you need.

  1. Product customer needs to buy (X)
  2. Product customer would get (Y)
  3. How much discount customer should get on (Y)

Follow these steps to create an automatic discount code. If you want detailed explanation then you can check here.

Step 1: Click on "Discounts" > "Automatic Discounts"

Step 2: Click on "Create Discount" > "Automatic Discount"

Step 3: Give some user friendly title and choose "Buy X get Y" from "Types"

Step 4: Setup your X & Y product along with discount and eligible quantities.

Following setup would give 50% off on "Ayres Chambray" when customer buys "5 panel Camp Cap".

If you have multiple products under category "X" which customers should buy, please add all of them under "Customer buys".

Step 5: Additionally you can setup start and end time for discounts. Finally review your discount code from top right corner and click on "Save"