How do I show only the available quantity on the product page? (Brooklyn Theme)

How do I show only the available quantity on the product page? (Brooklyn Theme) (ex: If there’s only 1 available art print, I want the shown quantity allowed to be added 1. Right now you can add as many and it sums up the price when you go to the cart. Thanks whoever can help out with this issue!

Best,

Manny

1 Like

Hello, @manzmac

Welcome to the Shopify community!
and Thanks for your Good question.

please add this code product-template file whenever do you have display


       {% if product.variants.first.inventory_management == "shopify" %}
          {% if product.variants.first.inventory_quantity > 0 %}
               We currently have {{ product.variants.first.inventory_quantity }} in stock.
          {% else %}
             The product is out of stock
          {% endif %}
       {% else %}
          This product is available
       {% endif %}
      

1 Like

Hi!

Thank you and thanks for your help. I tried to add that code to the “product.liquid”. Copied and pasted it at the end of the code, but it’s still having the issue of showing unlimited quanities. Did I place it in the correct spot? Thanks for you help!

1 Like

@manzmac

Thanks for update

can you please provide code so i will update,

Thanks, it worked,

but only for the first variant, when I change the product size or color for example it doesn’t change

how can I fix that?

@kaafbh

Thanks for post

what do you mean? please share store url and further issue screenshot

I’m not sure where this information is entered. Does it also apply to any variants?

1 Like

@terilloyd

Sorry you are facing this issue, it would be my pleasure to help you.

Welcome to the Shopify community! :blush:
Thanks for your good question.

Please share your site URL,
I will check out the issue and provide you a solution here.

www.Tx2quiltshop.com <>

Hi, same question. does it matter where you paste this code in product-template? is that product.liquid?

what do you mean by “please add this code product-template file whenever do you have display”‘’

1 Like

@marievett

can you please share store url!

Where do I input the code? My url is