How can I modify a custom liquid statement to display links only when a file is uploaded?

3 0 0

Hi can any one help me with this statement..I need it to modify if there is no link ..not to display anything..if there is file then only display the to use if and end if statement here please help moment this link shows up on every product even if there is no file uploaded the link still shows up on every product..I want the code to only show link in those products where I have uploaded my file 


Replies 2 (2)

46 0 17

Can try this... 

{% if product.metafields.custom.customfile != empty %}
  <!-- Put your existing code here -->
{% endif %}

Shopify Partner
176 18 16

Try this

{% if product.metafields.custom.customfile != blank %}


{% endif %}

★★★ Need help setting up your Shopify store? Hire me here: ★★★