Need To Add button (anchor tag) Under Out Of Stock Products Only

I need to add Button (anchor tag) under out of stock products only not in in stock products in shopify dawn theme. Can you please help me on it. My shopify store link is this https://primolfw.myshopify.com/.

1 Like

Hi @Mohsin_Khan

Please follow the instructions below.

  • From your Shopify admin dashboard, click on “Online Store” and then “Themes”.
  • Find the theme that you want to edit and click on “Actions” and then “Edit code”.
  • In the “Snippet” folder, click on “price.liquid” file. Find the code below. See image for reference.

   {{ 'products.product.sold_out' | t }}

  • After the said code, place the code below. See image above for reference

NOTE: Change “yourlinkhere” to your link and “Anchor link label” to your link label

Anchor link label

  • SAVE

Result should look like below.

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

But that anchor tag is also showing in “in stock products”, I just want to show it in Out of stock products.

Hello, You can check this video https://youtu.be/iyBsfgnDksc . I hope you will find your solution there.

Thanks,

Zahidul | Top Rated Shopify Expert
Upwork: https://www.upwork.com/freelancers/~01a13b2b094c9faf04

1 Like

You are awesome, but I want that in product template, but I manage your code there. So If someone want to add anything in Out of stock products only in product template department please use below code:

{% if product.available == false %}
If product is out of stock please find on other locations Click Here
{% endif %}

1 Like

Yes, you made it! Thanks.

1 Like