How to check if customer has done things ( purchased specifk product, purchased products for more than 500$ or things like this). I wanted to apply som javascript and css actions when these customer events take place
an exemple!
If customer purchases a product that contains (product name e.g “pax”) then apply this javascript or css event on a specifik element.
I’ve tried this but never works
text
{% if customer.purchased contains "pax" %}
{% endif %}
I’ve tried to put it like this in my account.liquid!
text
{% for order in customer.orders %}
{% for line_item in order.line_items %}
{% if line_item.total_price < 10 %}
{%break%}
{% endif %}
{% endfor %}
{% endfor %}
I edited the price larger or smaler than because my orders are in 0 dollars(fake orders)
but I don’t think that it is the problem.
But nothing happened!