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

Solved

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

bcfoodieguy
Excursionist
13 0 6

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 Partner
3477 463 535

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, marking it as a solution, or donating here .


B2B Solution & Custom Pricing | Product Labels by BSS


Need help from our expert? Kindly share your request with us via community@bsscommerce.com


BSS Commerce - Full-service eCommerce Agency

View solution in original post

Replies 4 (4)

zaczee
Globetrotter
855 46 42

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
13 0 6

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

BSS-Commerce
Shopify Partner
3477 463 535

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, marking it as a solution, or donating here .


B2B Solution & Custom Pricing | Product Labels by BSS


Need help from our expert? Kindly share your request with us via community@bsscommerce.com


BSS Commerce - Full-service eCommerce Agency
bcfoodieguy
Excursionist
13 0 6

This worked, thank you so much!