display liquid code based on vendor

orhl1234
Shopify Partner
36 0 0

I made a customized code but it didn't work. I have a vendor called ARTISAN
{% if product.vendor == 'ARTISAN' %}

<h1>ARTISAN products</h1>

{% endif %}

Replies 2 (2)

techlyser_web
Shopify Partner
1423 268 282

Hello @orhl1234 

Try this code
{% assign vendor_name = product.vendor | strip %}
  {% if vendor_name == 'ARTISAN' %}
      <h1>ARTISAN products</h1>
  {% endif %}
Was my reply helpful? Click Like to let me know!
Was your question answered? Mark it as an Accepted Solution.

Techlyser || Shopify Partner || Helping eCommerce Stores
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution.
- For further discussion contact: Email ID- info@techlyser.com

PageFly-Oliver
Astronaut
840 176 157

Hi @orhl1234 ,

You can try

 

{% if product.vendor contains 'ARTISAN' %}

<h1>ARTISAN products</h1>

{% endif %}

 

 

Hope my solution works perfectly for you!

Best regards,

Oliver | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


PageFly - #1 Page Builder for Shopify merchants.


All features are available from Free plan. Live Chat Support is available 24/7.