Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I am trying to our company phone number as a support line for specific products on our site but I'm having trouble getting it to show up properly. When I type in code like:
<p class="disclaimer__subtext">If you have any questions, reply to this email or contact us at <a href="mailto:{{ shop.email }}">{{ shop.email }}</a> {% if line.product.title == ‘Lumega-Z Liquid Eye Vitamin with AREDS 2 Nutrients’ %} or call <a href="tel:{{ shop.phone }}">{{ shop.phone }}</a> {% endif %}</script> {% if line.product.title == ‘GlaucoCetin Optic Nerve Cell + Eye Vitamin’ %} or call <a href="tel:{{ shop.phone }}">{{ shop.phone }}</a> {% endif %}</p>
and the result looks like this when I receive the order confirmation email after ordering only one of these products:
I realize after the fact I could have used this code as an or statement:
{% if line.product.title == ‘Lumega-Z Liquid Eye Vitamin with AREDS 2 Nutrients’ or if line.product.title == ‘GlaucoCetin Optic Nerve Cell + Eye Vitamin’ %} or call <a href="tel:{{ shop.phone }}">{{ shop.phone }}</a> {% endif %}
but the fact of the matter is that it still showed up twice even if I only ordered one of the items. What's to say if I order a product that's not supposed to see the phone number won't get it as well?
Any help would be appreciated
@LianaP ,
Comparing product title statically is not a good idea, instead you can create custom metafield and check if it's available.
How would I go about doing that?
Shopify and our financial partners regularly review and update verification requiremen...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025