Applying automatic discounts to abandoned checkout recovery emails

You can automatically apply a discount to your abandoned checkout recovery emails, which send a pre-filled cart to your customers to let them quickly complete their abandoned checkout at a discounted price, and they will need to enter only their payment details.

Before you begin

To get started setting up a discount for abandoned checkout recovery emails:

  1. Create a percentage discount code or a monetary discount code according to the type of promotion you want to offer.

  2. Make sure to make a note of the name you give your discount code when you create it, for example WelcomeBack. You assign a name to your discount code when you create a discount.

  3. Verify that your abandoned checkout recovery emails are configured to your liking on the Checkout page.

Edit the abandoned checkout recovery notification


  1. Under Orders, click Abandoned checkout:

  2. Find the line that includes:

    <td class="button__cell"><a href="{{ url }}" class="button__text">Items in your cart</a></td>

    And the line that includes {{ shop.url }}:

  3. Copy the code snippet below:

    {% if url contains '?' %}
      {{ url | append: '&discount=ABC' }}
      {% else %}
      {{ url | append: '?&discount=ABC' }}
    {% endif %}
  4. Paste the code snippet to replace {{ url }}, and {{ shop.url }}.

  5. Replace ABC in the example above with your discount code, for example WelcomeBack.

  6. Click Save.

Now all abandoned checkout recovery emails will have urls ending in discount=ABC and that discount is automatically applied to their checkout. Make sure you have set up your discount code in order for it to apply properly.

Ready to start selling with Shopify?

Try it free