How can I display stock levels for my products?

By default, 3dcart will show whether your products are in stock by simply listing the product as “In Stock.” However, some merchants may want to display the actual stock level for the product in order to let their customers know how much of the product is available for purchase.

To enable this, you will need to edit the HTML coding on the product’s listing template. The following steps will outline this process.

The following information applies to products that are not using advanced options (where inventory control is enabled for individual product options and variants).

If your products are using Advanced options, please click here for the Advanced Options version of this article.

Editing the Template

Using the left hand navigation menu:

  1. Go to Settings ->Design ->Themes & Styles
  2. Click on the “Edit Template (HTML)” button.

This will take you to the template editor for your store’s specific design theme and will show you a list of your theme’s HTML templates. Within this list, you will see your theme’s frame.html file as well as any other unique templates that the site is using.

  1. If you see a listing_x.html file in this list, look to the far right of it and click on its “Action ->Edit” button to open it up.
    On the other hand, if you don’t have any listing_x.html templates already listed for your theme, click on the drop-down menu located along the top and select the “templates/common” folder. This will display a listing of all available templates.

If you perform a CTRL-F search for the word “availability,” your browser should take you to the “Start: product_availability” block of code.

Within this block of code, you will see a bit of coding that reads:

<div id=”availability”>[availability_itemprop]</div>

At the end of that code, between [availability_itemprop] and </div>, add the dynamic variable [stock] so that the line looks like this:

<div id=”availability”>[availability_itemprop] [stock]</div>

Click Save at the top right of the screen and your product should now display Inventory Stock for the product’s inventory next to the In stock message.

Thank you for your understanding