> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://support.easystore.co/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Display product quantity & SKU on product page (2022 themes)

This article will guide you to have product quantity & SKU displayed on your website. With this, your customers would be able to identify how many products are left. When clicked, it will expand to show the available quantity for all variations too!

By having product quantity displayed on the product page, there are 2 files that need to be edited:
* main-product.liquid
* section-main-product.css

|| 📌 Note: These steps require to edit coding file that found in the new theme, example: Aroma, Kiddy, Vivid & etc. For 2020 or older themes, may refer [this link](/en/article/display-product-quantity-sku-on-product-page-2020-themes-3p7nna/)

![](https://storage.crisp.chat/users/helpdesk/website/b34797d9594d3000/image_z5z60z.png)

###### In this article :
1. [Display product quantity on product page](#1-1-display-product-quantity-on-product-page) 
2. [Display product SKU on product page](#1-2-display-product-sku-on-product-page) 
3. [Change the colour of the wording](#1-3-change-the-colour-of-the-wording)
    
||| ⚠️ Kindly take note:

* Above all code editing, you will need to re-edit the code again if you switch to a new theme template
    
* We do not allow to change or edit the code for the **checkout page** (which include shipping & payment method) due to security reasons
    
* Make sure that you have selected **EasyStore tracks inventory of this product**
    
* Make sure the inventory quantity is not 0nor else the product quantity will not be displayed on the product page.
    
![](https://storage.crisp.chat/users/helpdesk/website/680b3bfa422dc800/77eccda8-9e01-47a2-9366-4a6a64_rtves8.png)
---
# 1. Display product quantity on product page

**Step 1:** Go to [EasyStore Admin](https://admin.easystore.co/) > Channels > Online Store > Edit source > sections > **main-product.liquid**
**Step 2** : Look for `{% app_snippet 'product/button' %}` and add `<div id="product-stock-display"></div>` code **above** it.

![](https://storage.crisp.chat/users/helpdesk/website/b34797d9594d3000/be-33_amxqr6.png)

**Step 3 :** Save

**Step 4 :** Look for `VariantSelector.onVariantChange(variant,"{{ section.__key }}");` and **paste code below it**.

```css
document.getElementById('product-stock-display').innerHTML = ''; if(variant.available && variant.inventory_quantity > 0){ document.getElementById('product-stock-display').innerHTML = variant.inventory_quantity+' piece available'; if(variant.title != 'Default Title') document.getElementById('product-stock-display').innerHTML = +variant.inventory_quantity+' piece available'; }
```

|| 📌 **Note :** You can change the word "`piece available`" into your preferred text

![](https://storage.crisp.chat/users/helpdesk/website/b34797d9594d3000/image_jh6z9z.png)

**Step 5** : Save and you're done

**Attached GIF image as extra reference:**

![](https://storage.crisp.chat/users/helpdesk/website/b34797d9594d3000/new-coding-aroma_1a1bju6.gif)
---
# 2. Display product SKU on product page

||| **📌 Important Note :** Make sure you have filled in the **SKU** section at  **products page** to display SKU on product page.

![](https://storage.crisp.chat/users/helpdesk/website/b34797d9594d3000/be-34_148y54f.png)

**Step 1:** Go to [EasyStore Admin](https://admin.easystore.co/) > Channels > Online Store > Edit source > sections > **main-product. Liquid**

**Step2 ：**Add this code `<div id="product-sku-display"></div>`  before `{% app_snippet 'product/button' %}`

![](https://storage.crisp.chat/users/helpdesk/website/b34797d9594d3000/image_10e6z9f.png)

**Step 3 :** Save

**Step 4 :** Look for `VariantSelector.onVariantChange(variant)` and paste code below it. **if (variant.available)**

Copy this code

```css
if(variant.available && variant.sku != ''){$('#product-sku-display').text('SKU: '+variant.sku);}else{$('#product-sku-display').text('');}
```

![](https://storage.crisp.chat/users/helpdesk/website/b34797d9594d3000/image_1pb48hl.png)

**Step 5 :** Save

**Result :**

![](https://storage.crisp.chat/users/helpdesk/website/b34797d9594d3000/image_v8t0ph.png)

| 💡 Tips: To switch position between SKU & product quantity display, change the code position `<div id="product-sku-display"></div>` & `<div id="product-stock-display"></div>` will do.

![](https://storage.crisp.chat/users/helpdesk/website/b34797d9594d3000/be-35_23ktgq.png)

Result:

![](https://storage.crisp.chat/users/helpdesk/website/b34797d9594d3000/image_nfijh.png)
---
# 3. Change the colour of the wording

**Step 1:** Go to [EasyStore Admin](https://admin.easystore.co/) > Channels > Online Store > Edit source > assets > **section-main-product.css**

**Step2 :** Copy this code

**Product Quantity:**

`#product-stock-display { color: #000000; }`

**Product SKU:**

`#product-sku-display { color: #000000; }`

and paste it at the bottom of the **section-main-product.css** file. You may get the color hex code (#EA2121) of your preferred color [here](https://www.rapidtables.com/web/color/html-color-codes.html)

![](https://storage.crisp.chat/users/helpdesk/website/b34797d9594d3000/image_10ett4c.png)

**Step 3 :** Save and here's the result

![](https://storage.crisp.chat/users/helpdesk/website/b34797d9594d3000/image_177zsvq.png)