Shopify themes, liquid, logos, and UX
How to disable the Buy It Now button for products that are out of stock?
Hello,
Please share "Store URL"
Thanks!
We do this automatically in our pre-order app (Early Bird) using Javascript (when we show a back-order or "Notify me" button), but I think it'd be simpler to do this in Liquid if you have some theme coding knowledge.
You can find the conditions used to show the Sold out button, and copy that logic to wrap around the Buy it Now button, so it only renders it if the product is in stock.
Hello @TE-A-ME
Please share your store URL and password.
So that I will check and let you know the exact solution here.
Hi @TE-A-ME,
Please send me the code of main-product.liquid file, I will help you check it
@TE-A-ME Your best bet is modifying theme code - you can do it through Javascript or you can hide the button altogether with CSS.
IMO, if you're considering removing the Buy it Now button, you should definitely consider using a preorder flow on the product. Most preorder apps - including STOQ, which we run full time - will automatically hide the Buy it now button on out of stock products that are configured for preorder. So not only do you have the issue of hiding it resolved, you can also get preorders on them and have a chance to get orders in ahead of any restocks. 🙂
Founder & CEO, Artos Software
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