> For the complete documentation index, see [llms.txt](https://docs.themeware.design/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.themeware.design/additional-features/extensions/product-badges/stock-badge.md).

# Stock badge

The **stock badge** shows the stock of a product – in the product box on listing pages and on the product page (gallery or buybox).

***

## Configuration

### **Theme configuration**

#### **Listing pages**

1. Go to the "**Listing pages**" tab
2. Expand the "**Product badges (in the product box)**" block
3. Scroll to the section "**Badge: Stock badge**"
4. Enable the configuration "**Show stock badge**"
5. Save your changes after editing

#### **Product pages**

1. Go to the "**Product pages**" tab
2. Expand the "**Product badges (in the image gallery or buy box)**" block
3. Scroll to the section "**Badge: Stock badge**"
4. Set the configuration "**Show stock badge**" to "**show in the image gallery**" or "**show in the buy box**"
5. Save your changes after editing

{% hint style="info" %}
**Note**: The badge is displayed if the stock badge is enabled – permanently or only above/below the thresholds, depending on the selected mode (see Options).
{% endhint %}

***

## Options

You control the display mode and the thresholds in the "**Content**" tab:

> Tab "Content" => Block "Product badges" => Section "Badge: Stock badge"

* **Mode**
  * "Show stock above/below the threshold": The badge only appears for low stock (below "Threshold (low stock)") or high stock (above "Threshold (high stock)").
  * "Always show stock": The current stock is shown regardless of the thresholds.
* **Threshold (low stock)** / **Threshold (high stock)**: Limits for the "above/below the threshold" mode.

***

## Summary

#### Theme configuration

* Tab "Listing pages" => Block "Product badges (in the product box)" => Section "Badge: Stock badge" => Show stock badge
* Tab "Product pages" => Block "Product badges (in the image gallery or buy box)" => Section "Badge: Stock badge" => Show stock badge
* Tab "Content" => Block "Product badges" => Section "Badge: Stock badge" => Mode
* Tab "Content" => Block "Product badges" => Section "Badge: Stock badge" => Threshold (low stock) / Threshold (high stock)

#### Snippets

* `twt.extension.stockBadge.highStock.label`
  * `%stock%` is replaced by the "Threshold (high stock)".
* `twt.extension.stockBadge.lowStock.label`
  * `%stock%` is replaced by the available stock.
* `twt.extension.stockBadge.stock.label`
  * `%stock%` is replaced by the available stock.
* `twt.extension.stockBadge.highStock.icon`
  * **Note**: May be replaced by a theme configuration.
* `twt.extension.stockBadge.lowStock.icon`
  * **Note**: May be replaced by a theme configuration.
