Looking for a way to alert customers that they already bought a product

Solved
WTS_DrSue
Tourist
7 1 0

Good afternoon - I'm hoping someone can help.

I sell ebooks from my website using Shopify Lite. (Example bookstore page)

Recently, several customers have bought the same ebook twice, and I noticed that amazon has an alert that comes up on their site saying "You already purchased this ebook."

 

Does Shopify have a functionality like this and how do I make it work with Shopify Lite?

 

Many thanks

J

Accepted Solution (1)
WTS_DrSue
Tourist
7 1 0

This is an accepted solution.

Thanks a lot - that makes sense, both in terms of why and how. Guess I need to educate my readers to log in, and then set up a way to tag them.

 

View solution in original post

Replies 6 (6)
mnearents
Shopify Partner
77 4 39

Where are you wanting this alert to show up?

WTS_DrSue
Tourist
7 1 0
Ideally, when they add it to their cart. Latest, before they check out.
mnearents
Shopify Partner
77 4 39

I guess I didn't think about it but the problem is customers aren't always signed in, so you can require sign-in at checkout, but you can't (that I know of) customize the checkout to alert the customer. Maybe on Shopify Plus it's possible. In order to know if a customer has purchased a certain book, they would have to be signed in always. 

 

If you can guarantee your shoppers are signed in, then you can totally use liquid to display a warning on the product page or in the cart. The easiest way would be to have an app tag customers with the product skus they purchase. Then in your theme, you can add code to check if the product sku is present in the customer's tags and then if so, display whatever you want.

If you don't want to do tags, you could do metafields as well. Would still require an app to write the sku to the customer's metafields.

 

Without tagging or metafields, you could also loop through the customer's orders

 

{% for order in customer.orders %}
  {{ order.id }}
{% endfor %}

And then for each order loop through the order.line_items and see if the product sku is present.

mnearents
Shopify Partner
77 4 39

You could also wrap your cart.liquid in code that checks if the user is logged in, and if not it redirects them to the login page. This would need some testing as I'm not sure their products would stay in the cart after login (I assume they would). But that way the cart can't be accessed unless they're signed in and you can check their tags/metafields/orders.

 

But this isn't a great experience for customers and could hurt your conversion rates.

WTS_DrSue
Tourist
7 1 0

Yes, I can see how that's less than ideal. I do a bit of education work first. Thank you!

WTS_DrSue
Tourist
7 1 0

This is an accepted solution.

Thanks a lot - that makes sense, both in terms of why and how. Guess I need to educate my readers to log in, and then set up a way to tag them.