New Shopify Certification now available: Liquid Storefronts for Theme Developers

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

Solved
bcfoodieguy
Excursionist
11 0 4

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!

Accepted Solution (1)
BSS-Commerce
Shopify Expert
2942 394 414

This is an accepted solution.

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 

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.

For B2B solutions and custom pricing, check out B2B Solution & Custom Pricing |
For adding product labels/badges, visit Product Labels by BSS

BSS Commerce - Shopify Apps & Store Development Service Provider

Hire a Shopify expert | Shopify Plus Store Development

View solution in original post

Replies 4 (4)
zaczee
Globetrotter
759 42 35

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

bcfoodieguy
Excursionist
11 0 4

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

BSS-Commerce
Shopify Expert
2942 394 414

This is an accepted solution.

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 

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.

For B2B solutions and custom pricing, check out B2B Solution & Custom Pricing |
For adding product labels/badges, visit Product Labels by BSS

BSS Commerce - Shopify Apps & Store Development Service Provider

Hire a Shopify expert | Shopify Plus Store Development

bcfoodieguy
Excursionist
11 0 4

This worked, thank you so much!