Changing sold out button for a specific product

SwissMadison
New Member
2 0 0

Hello,

We are trying to change the sold-out button on 1 specific product to have a link to the Home Depot instead as we are currently exclusive with them for 1 product. I see the button in the code here 

SwissMadison_0-1614365230465.png

But we cannot figure out how to change the text to "Available at Home Depot" and then turn the button into a link for this one product. I would assume you would need to create another button class specifically for the home depot but I can't figure out how to use an if statement in Javascript as I am not familiar with the code. Can anyone help us out please?

0 Likes
Ninthony
Shopify Partner
1794 258 706

Wrap the whole button in a code that checks your product's handle:

{% unless product.handle == 'your-product-handle' %}
<button>
//code for your button to add your product normally
</button>
{% else %}
<a href="https://www.homedepot.com/link-to-your-product">Shop At Home Depot</a>
{% endunless %}

 

If you need help I can do this for you. Feel free to send me a DM with your store url and the product you want to add it to and I can request access to the theme and make the change.

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes
SwissMadison
New Member
2 0 0

Could you please do it for me? That would be amazing! Our store url is "https://swissmadison.myshopify.com/"

0 Likes
Ninthony
Shopify Partner
1794 258 706

I requested access to your store. You should get an email in the one associated with your store to approve or deny me. Which product do you want to change? And also, what is the home depot link for your product?

If my solution helped you, please like and accept as solution!
If you'd like to make any edits to your store, please send me a personal message and we can discuss what you'd like to accomplish :D
0 Likes