liquid - Shopify vendor if statement -


a shopify liquid question:

if no vendor available, shopify adds shop name default vendor. i'd instances blank.

i'm trying create if statement hides vendor if there no vendor or if equals default vendor name.

here's i've come far , i'm stuck

<div class="prod-caption">{% if product.vendor == 'test' %} {% else %} {{ product.vendor }} {% endif %} {{ product.title }}</div> 

i want on product page in product grid item snippet

can help?

what you've got looks should work (assuming replace 'test' shop's name), i'd write if statement this:

{% if product.vendor != shop.name %}{{ product.vendor }}{% endif %} {{ product.title }} 

this work in both product.liquid , product-grid-item.liquid. (just search {{ product.title }} , replace code above.)


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -