Automate Discount to my customers

Solved
Kristanantony
New Member
3 0 0

Hi !

My store is about to go live. I am just stuck with one problem.

I am selling a product and when a customer buys it they would be eligible to avail Flat 70% discount on other products on my website.
Now how do I track and do this?

For if customers pay through PayPal will it reflect in my customer of Shopify with Email ID?
When they checkout, yes it would reflect and I can get their email ID to send the Discount code.


0 Likes

This is an accepted solution.

Hi @Kristanantony!

You could add a discount code to the order confirmation email sent by Shopify (Settings > Notifications > Order confirmation).

LukaszWiktor_0-1612959942229.png

 

To include the discount only if a customer bought a specific product, you'd need to use the following code:

 

{% assign product_titles = line_items | map: "product" | map: "title" %}
{% if product_titles contains 'XYZ' %} 
    DISCOUNT CODE
{% endif %}

 

Replacing 'XYZ' with the product name that entitles to the discount.

I guess that you don't want to send the same discount code to each customer, because when the code leaks, then others may use it without purchasing the product that makes them eligible to the discount. In such case you can use Personal Discount app to automatically generate a unique discount code for each customer who purchased the specific product. You'd still need to edit the order confirmation email as above, but instead of DISCOUNT CODE you'd insert a code snippet from Personal Discount.

 

 

I'm a software engineer. I make things happen automatically.
Kristanantony
New Member
3 0 0

Hi Lukas

This is great but I am not able to find the exact spot where I can copy this code. let me know.

Kristanantony_0-1613328135306.png

 

0 Likes

You can insert the code snippet below {% endif %} and above {% endcapture %}.

LukaszWiktor_3-1613388929555.png

Notice the <br> tag to show the discount code in a new line.

Alternatively, you can add the code snippet below a line that contains <p>{{ email_body }}<p>. You

LukaszWiktor_4-1613389091238.png

 

 

I'm a software engineer. I make things happen automatically.
0 Likes