Skip to main content
All CollectionsContentCart layout
Show or hide content based on specific values
Show or hide content based on specific values
Updated over 10 months ago

Anything captured by the script will be available to use in the cart layout, and the values can be called upon to display or hide content.

For example, say you only wanted to display prices if the product was in a specific category:

{% for product in products if product|is_in_categories(['example1', 'example2']) %} {# this will only show products in either the example1 or example2 categories #} {% endfor %}

Or, if you wished to hide a product's price where it was over a specific value:

{% for product in products if product.uv < 100 %} {# this will only show products where the unit value (uv) is below 100 #} {% endfor %}

Did this answer your question?