Field evaluation based on collection list

piotrsznajder
New Member
6 0 0

I need to display shipping time, if the product is in "Europe Warehouse" collection then the field should display "1-5 days"

if there product is not listed in "Europe Warehouse" collection

then then the field should display "5-20 days"

Below my code. It almost work, but unfortunately if there is more collection it always repeat the result, And for product that is in Europe Warehouse it shows 1-5 days, but for all other product that are in few collections it shows: 5-20 days 5-20 days 5-20 days 5-20 days 5-20 days

CODE:

{% for collection in product.collections %} {% if collection.title contains "Europe Warehouse" %}

Shipping time: 1-5 days

{% then %} Shipping time: 5-20 days

{% endif %}

{% endfor %}

0 Likes