Hide Buy and Quantity box in sold out products.

Topic summary

A user seeks to hide the quantity selector and “Buy It Now” button specifically on sold-out products while keeping them visible on available items.

Proposed Solution:

  • Navigate to Online Store → Edit Code → theme.liquid file
  • Insert conditional code above the </body> tag that uses {% if product.available %} logic
  • The code snippet wraps display elements to hide them when products are unavailable

Follow-up Issue:
Another user reports the solution successfully hides the quantity selector box, but the text label “quantity” still appears and needs removal.

Status: The discussion remains open with an unresolved secondary issue regarding the remaining quantity label text.

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

Hello There ,

Is there any way to hide the quantity box and buy it now buttons only in the sold out products . I do not want the buttons to get affected in available products . Can anyone assist me with this .

Thank You!!

Hey @jnud21

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code in the bottom of the file above tag

{% if product.available %}

{% else %}

{% endif %}

If I managed to help you then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

2 Likes

Hi Moeed,

Thanks for this solution! My site doesn’t display the quantity selector itself anymore, but it still shows the word ‘quantity’. Can I remove this somehow too?

Thanks so much!