Custom fields

How would I apply a custom field so that it only appears when a specific item is in the cart? I don’t want the custom field to be visible for all products.

Is that possible?

Something like this where 15 is the product ID you’re looking for:

{% set showField = false %}
{% for item in items %}
    {% if item.product and item.product.id == 15 %} 
        {% set showField = true %}
    {% endif %}
{% endfor %}

{% if showField %}
    ... field here ...
{% endif %}
1 Like

Worked perfectly - thank you.