Shopify themes, liquid, logos, and UX
I create a metafield fo promos to put on my product page.
some of my products hvae promos, others don't.
In the product page template on the theme editor, I added the offer block to display the metafield.
How do I add conditionoal logic on the element to display it only when there is something in the metafield?
thanks.
Hi @PeakFlava to avoid code use an alternate template
For coding roughly it's {% if product.metafields.namespace.key.value != blank %} ... {% endif %}
Read the liquid docs here https://shopify.dev/api/liquid/objects/metafield
If you need deeper customization then contact me for services
Contact info in forum signature.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Good Luck.
Contact paull.newton+shopifyforum@gmail.com for the solutions you need
Save time & money ,Ask Questions The Smart Way
Problem Solved? ✔Accept and Like solutions to help future merchants
Answers powered by coffee Thank Paul with a ☕ Coffee for more answers or donate to eff.org
Thanks Paul,
I found a way to do it with coding on the theme liquid file. I used a new template in the meantime until i figure it out.
Thanks again
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024