Created
September 3, 2014 07:28
-
-
Save joeldrapper/d965b12d40957b6479b6 to your computer and use it in GitHub Desktop.
Shopify "you ordered this before" message for the product page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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