Personalized checkout and custom promotions with Shopify Scripts
Hello! I’m looking for help. I have this section of code added to my product pages, but I want to exclude it from a certain page. I thought maybe by using the unless code, but I’m unsure of how to change it while still keeping the ability of it to be hidden if the meta field is blank. I hope this makes sense. Please help!
You may not need an unless.
Does something like the below help at all?
{% if product.metafields.custom.product_video != blank and product.handle != "foo" %}
...
{% endif %}
I would rarely add the handle into an if statement like this and would be more likely to start added a list of allowed (or blocked) pages and comparing against that. If you think you'll only need that one product page to ignore that the above code might be enough for now.
{% if product.metafields.custom.product_video.value != blank %}
//your iframe here...
{% endif %}
2m ago Learn the essential skills to navigate the Shopify admin with confidence. T...
By Shopify Feb 12, 2025Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025