The code below shows you how to replace the numeric inventory levels with your own text. This is useful if you want to hide the exact number of products you have remaining in your inventory. For example, instead of showing that you only have 1 product left, you could change it to say "Low Stock", or if you have more than 1 product you could display "In Stock".
Login to your control panel and navigate to Design -> Theme Files/Edit HTML & CSS and open the product.html file.
Add the following code under the %%Panel.Footer%% text :
Save your changes.
How It Works
If you have the inventory option enabled in your store you should see the new text instead of the numeric values on the product pages. If you have 3 or more products in your inventory then the level will show "In Stock", anything below that will display a "Low Stock" message. You can change the messages by modifying the two variables in the script: inStockMessage and lowStockMessage. The code will also work with product options where each SKU has a different inventory level.
If the inventory levels do not show up... then turn on inventory tracking from the control panel by navigating to Setup & Tools -> Inventory and selecting the Show Stock Levels option under the Stock level section. You must also turn on inventory tracking for each individual product.
For all other questions, comments, or modifications... contact our experienced Bigcommerce developers!