Please hid the buy now button when an item is soldout.

Topic summary

A user needs to hide the “Buy Now” button specifically when products are sold out on their Shopify store. An image shows the current product page layout.

Proposed Solution:

  • Add custom CSS code to the theme.liquid file before the </body> tag
  • The code should target and hide the button when inventory is unavailable

Issue Identified:

  • The suggested code hides the “Buy Now” button for all products on mobile devices, not just sold-out items
  • The solution needs refinement to conditionally hide the button based on stock status only

Status: The discussion remains open with an unresolved technical issue requiring a corrected code snippet that properly checks inventory availability.

Summarized with AI on October 31. AI used: claude-sonnet-4-5-20250929.

https://xfztr448onq3bqw1-71576191201.shopifypreview.com

please help to hide the buy now button when an item is soldout

Hi @Shahil1 ,

Go to your Shopify Admin Panel.

Navigate to Online Store → Themes.

Click on Edit Code (not Customize).

Open the theme.liquid file (found inside the Layout folder).

Scroll down and paste the code just before the tag:


hi this hides the buy now button for all products on the mobile