How do I show Stock Level on product/collection page in Barehouse theme

Shop Link: https://backcountryfoodie.myshopify.com/

Theme: Warehouse

Hello! We’re trying to include inventory count both on the individual product pages and the collection pages. However we do NOT have a product.theme.liquid file. Not sure what to do. Any help would be appreciated!

Hi,

We can add the stock level on the product or collection page by customizing the liquid files. The Template file name differs for each theme

Do you know what files specifically and what code needs to be added?

Hi @bcfoodieguy ,

Code displaying the product’s inventory number:

{% if product.first_available_variant.inventory_quantity > 0 %}
Left {{ product.first_available_variant.inventory_quantity }}
{% endif %}

+) Instructions for finding files to add code:

A. For product pages:

  1. In Shopify admin > Online store > Themes > Edit code

  2. Enter the keyword ‘product’ into the search bar and try checking the files rendered in the section (check the following files first if there are any: main-product, product-item, product-grid): https:/ /www.awesomescreenshot.com/image/44205521?key=95a936112cc1dc15d19a3cb9841d93a7

Tip: Try adding any text above the file, then Save and go back to the product page in the font store and reload to see if it appears or not. => If yes, the correct file has been found
3. After finding the correct file, add the code above to the position where you want to display the stock-level product

B. For collection page: Do the same, replace keyword ‘product’ = ‘collection’

Hope it helps @bcfoodieguy

This worked, thank you so much!