Skip to content

Instantly share code, notes, and snippets.

@joeldrapper
Created September 3, 2014 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joeldrapper/d965b12d40957b6479b6 to your computer and use it in GitHub Desktop.
Save joeldrapper/d965b12d40957b6479b6 to your computer and use it in GitHub Desktop.
Shopify "you ordered this before" message for the product page
{% if customer.orders.size != 0 %}
{% assign orderfound = false %}
{% for order in customer.orders %}
{% if orderfound == false %}
{% for line_item in order.line_items %}
{% if line_item.product.url == product.url and orderfound == false %}
{% assign orderfound = true %}
<p>
You ordered this on {{ order.created_at | date: "%b %d, %Y" }}. <a href="{{ order.customer_url }}">View Order</a>
</p>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment