Get the date of the last order that has a tag

Shopify Partner
1 0 0

I need to hide something from customers if their last order, with a certain tag, is not older than 30 days.

At the moment I have the content hidden by tag only:

{% assign used = false %}
{% for order in customer.orders %}
	{% for tag in order.tags %}
	    {% if tag == "Special Discount" %}
        	{% assign used = true %}
        {% endif %}
	{% endfor %}
{% endfor %}

Any help on getting the date on that specific order would be greatly appriciated.

Thanks :)

0 Likes
Highlighted
Shopify Expert
685 0 68

order.created_at — https://help.shopify.com/themes/liquid/objects/order#order-created_at

I'm a million different people
0 Likes