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

manzmac
New Member
2 0 2

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

KetanKumar
Shopify Partner
18896 1984 6992

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 

<div id="variant-inventory">
       {% if product.variants.first.inventory_management == "shopify" %}
          {% if product.variants.first.inventory_quantity > 0 %}
              <span class="green"> We currently have {{ product.variants.first.inventory_quantity }} in stock.</span>
          {% else %}
           <span class="ofstock">  The product is out of stock</span>
          {% endif %}
       {% else %}
          <span class="green">This product is available</span>
       {% endif %}
      </div>

 

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Expert | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
manzmac
New Member
2 0 2

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!

KetanKumar
Shopify Partner
18896 1984 6992

@manzmac 

Thanks for update

can you please provide code so i will update,

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Expert | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes
kaafbh
New Member
1 0 0

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?

0 Likes
KetanKumar
Shopify Partner
18896 1984 6992

@kaafbh 

Thanks for post 

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

If helpful then please Like and Accept Solution.
Want to modify or custom changes on store Hire me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help
Shopify Expert | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
0 Likes