Why doesn't my product tags code work in specific input fields?

Hey the Community,

I need help to show input field in specific product by tag using code.

Here is my code but it doesn’t work.

{% case product.tags %}
     {% when "custom-image" %}
  {% render 'custom-fields-image-personnalisable' %}
     {% when 'custom-texte' %}
  {% render 'custom-fields-texte' %}
{% endcase %} 

I already create the snippet

  • custom-fields-image-personnalisable
  • custom-fields-texte

It works when I use :

product-type

but not for :

product-tags

Is anyone has a solution for this ? :grinning_face:

Best regards,

Dorian

1 Like

Hi @PDDOD ,

This is Richard from PageFly - Landing page builder, I’d like to suggest this idea:

{% if product.tags contains 'custom-image' %}
  {% render 'custom-fields-image-personnalisable' %}
{% elsif product.tags contains 'custom-texte' %}
  {% render 'custom-fields-texte' %}
{% endif %}

I hope it would help you
Best regards,

Richard | PageFly

1 Like

It work perfectly ! Thanks a lot Richard

1 Like