Hey @paulson1 ,
To display the discount code only to first-time customers on the Thank You page, you can use Shopify’s customer.order_count Liquid attribute. This attribute allows you to check if the logged-in customer has placed only one order, indicating a first-time buyer. Here’s how you can set this up:
1.Use Liquid Code on the Thank You Page to Identify First-Time Buyers:
In Shopify, you can edit the Order status page to add custom scripts that will only display the discount code to customers who have placed their first order.
-Go to Setting > Checkout in your Shopify admin.
-Scroll down to the Order status page section.
-In the Additional scripts box, add the following code:
{% if customer and customer.orders_count == 1 %}
## Thank You for Your First Purchase!
As a special gift, here’s a 10% discount on your next order:
### Use Code: WELCOME10
{% endif %}
This code checks if:
-The customer is logged in (customer).
-They have only completed one order (customer.order_count)
- Sending the Discount Code via Email or SMS:
To send the discount code to first-time customers only, follow these steps:
-Use Shopify Email or an app like Klaviyo to create an automated email campaign targeting customers who have just made their first purchase.
-For SMS, apps like PostScript allow you to set up automated messages for specific segments (e.g., first-time buyers).
This setup ensures that only first-time customers see the discount code on their Thank You page and receive it through email or SMS.
Could you please send me a message via email so we can discuss this further?
Thanks