The reason it didn't work, @sspind , is because 9775609 might not be on the first level of the category tree; it might be on the second or third level.
You should loop on each level so 9775609 will be found. Do it like this:
{% for category in shop.categories %}
{% if category.id == '9775609' %}
{% include 'snippets/kategorietop.rain' %}
{% else %}
{# --- drill to the 2nd level -- #}
{% if category.subs %}
{% for category in category.subs %}
{% if category.id == '9775609' %}
{% include 'snippets/kategorietop.rain' %}
{% else %}
{% if category.subs %}
{# --- drill to the 3rd level -- #}
{% for category in category.subs %}
{% if category.id == '9775609' %}
{% include 'snippets/kategorietop.rain' %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{% endif %}
{% endfor %}
Wij verkopen alle soorten witgoed en inbouw apparaten. Wij bezorgen uw gewenste witgoed gratis aan huis. Ook voor het aansluiten of inbouwen van uw witgoed apparatuur bent u bij ons aan het juiste adres!
5 comments
{% for category in product.categories %}
<div> {{ category.title }} </div>
{% endfor %}
This works.
Thanks, @rgisme ,
Let us know if you have any additional questions.
Geanny
Ok can you pls tell me why this is not working in collection rain.
{% for category in shop.categories %}
{%if category.id == '9775609' %} {% include 'snippets/kategorietop.rain' %} {% endif %}
{% endfor %}
I also tried
{% for category in product.categories %}
does not show eather anything
It should show a snippet selected by a special product category.
The reason it didn't work, @sspind , is because 9775609 might not be on the first level of the category tree; it might be on the second or third level.
You should loop on each level so 9775609 will be found. Do it like this:
Wij verkopen alle soorten witgoed en inbouw apparaten. Wij bezorgen uw gewenste witgoed gratis aan huis. Ook voor het aansluiten of inbouwen van uw witgoed apparatuur bent u bij ons aan het juiste adres!
https://www.paulissenwitgoed.shop