We’re using the Providence theme. We created a snippet called custom.cart.message that contains a message we want to display on our cart page when a certain product has been added to that page.
Using the following {% render ‘custom-cart-message’ %} we can successfully display the custom snippet on cart-template.liquid.
However, as soon as we attempt to wrap that render snippet in an “if” statement, it no longer displays. There are no syntax errors displayed in Shopify, and we’ve tried using product.handle, product.title, and product.id with no luck. Is there a specific syntax needed for IF statements on the cart page?
The product handle is as shown below.
{% if product.handle contains “cheese-of-course” %}
{% render ‘custom-cart-message’ %}
{% endif %}