Shopify themes, liquid, logos, and UX
Hi guys
I've created a product metafield custom.alt_product_title which will house an Alternative Product Title.
I'd like to use some custom code on my Product Page and Collection Page templates so that if this metafield is not empty, it populates that, or it populates the standard product title field.
For example here's a section of the theme code where it renders the Product Title:
<p class="card__title font-bold{% if settings.show_dividers %} mb-1{% else %} mt-1 mb-0{% endif %}">
<a href="{{ product_url }}" class="card-link text-current js-prod-link">
{{- product.title | escape -}}
</a>
</p>
How would I write the code so that if the metafield custom.alt_product_title is not empty, it populates that instead?
Thanks!
Jacqui
Worked perfectly, thank you so much!
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025