Within the product page, I would like to hide a certain element if the current product isn't associated with any collection. Is there any way to check it with Liquid ?
The object product.collections is an array containing all collections where the product is listed.
So you may use this:
{% if product.collections.size < 1 %}
Do something
{% endif %}
Documentation about arrays here: https://shopify.dev/api/liquid/filters#size
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments