---
title: Price by Quantity – Dynamic Pricing
description: "### Main Features - Customize pricing based on quantity of a product, a category, a tag, or cart level. - Show messages to customers to show them how much discount they're getting on bulk purchase - You can use **total…"
url: "https://wpfactory.com/docs/price-by-quantity-dynamic-pricing/"
updated: "2025-05-07"
---

# Price by Quantity – Dynamic Pricing

### Main Features

- Customize pricing based on quantity of a product, a category, a tag, or cart level.
- Show messages to customers to show them how much discount they're getting on bulk purchase
- You can use **total cart quantity** or **product quantity**.
- Optionally you can set to apply the wholesale discount only **if no other cart discounts were applied**.
- Discounts can be set as **percent** from the original price, **fixed** discount, or set **price directly** on a per-product basis.
- Additionally, you can set different wholesale pricing options for different **user roles**.
- If you want to display a price table or other data on the frontend, there are [**shortcodes**](#shortcodes) included in the plugin.
- Show discount pricing table on product page
- Fully compatible with WooCommerce, ensuring seamless integration into your online store.

### Product Price by Quantity Options

Plugin settings are located in "WooCommerce > Settings > Product Price by Quantity".

- [General](#section-settings)
  - [Settings](#section-settings)
  - [Discount](#section-discount)
  - [General](#section-general)
  - [Compatibility](#section-compatibility-options)
- [All Products](#section-all-products)
- [User Roles](#section-user-roles)
- [Info](#section-info-cart-page)
  - [Cart page](#section-info-cart-page)
  - [Discount Pricing Table](#section-info-discount-pricing-table)
  - [Replace Price](#section-info-replace-price)
- [Price Display by Quantity](#section-price-display-by-quantity)
- [Dropdown](#section-dropdown)
- [Advanced](#section-advanced-options)
- [Tools](#section-tools)
- [Shortcodes](#shortcodes)

### Settings

Here you choose at which level you want to set wholesale discount options. To set it for all products at once visit the "All Products" section.

![Wholesale Pricing for WooCommerce - General - Settings](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-General-Settings.png)

**Per product**
: This will add new settings meta box to each product's edit page.

: Default: `yes`

**Per variation**
: Enable this if you want to set options for each variation of a variable product separately.

: Default: `no`

**Per product category**
: This will add new settings fields to each product category edit page.

: Default: `no`

**Per product tag**
: This will add new settings fields to each product tag edit page.

: Default: `no`

### Discount

![Discount Type](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-General-Discount-Type.png)

**Discount type**
: Possible values: Percent; Fixed.

: Default: `Percent`

### General

![General Options](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-General-Options-v2.6.2.png)

**Rounding**
: Round calculated product wholesale price according to the "Number of decimals" option.

: Default: `yes`

**Quantity calculation**
: Possible values: Single product quantity; Total cart quantity; Group by product parent (e.g. for variations); Group by product category; Group by product tag.

: Default: `Single product quantity`

**Other cart discounts**
: Apply wholesale discount only if no other cart discounts were applied.

: Default: `no`

**Formula and shortcodes**
: Process formula and shortcodes in discount table values (i.e. in "Min quantity #X" and "Discount #X" fields).

: Default: `no`

**Admin recalculate order**
: Adds "Recalculate" button to admin order pages.

: Default: `yes`

**Admin recalculate order: Require confirmation**
: : Default: `yes`

**Admin recalculate order: Add order note**
: : Default: `yes`

### Compatibility Options

![Compatibility Options](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-Compatibility-Options.png)

**WCFM plugin compatibility**
: : Default: `no`

**WCFM plugin compatibility: New product notification**
: : Default:

```
Please save the product first.
```

**"Lumise - Product Designer Tool" plugin compatibility**
: : Default: `no`

### All Products

You can exclude selected products in the [Advanced](#section-advanced-options) section.

![Wholesale Pricing for WooCommerce - Wholesale Table Options](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-Wholesale-Table-Options-e1568908549597.png)

**Number of levels**
: Save settings after you change this option (new settings fields will be shown).

: Default: `1`

**Min quantity #X**
: Minimum quantity to apply discount.

: Default: `0`

**Discount #X**
: To set fee instead of discount - enter negative number.

: Default: `0`

### User Roles

If you want to set different wholesale pricing options for different user roles, fill this section.

![Wholesale Pricing for WooCommerce - Additional User Roles Options](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-Additional-User-Roles-Options-e1568908607976.png)

**User roles settings**
: Save settings after you change this option (new settings fields will be shown). Leave blank to disable.

: Default: *None*

### Info: Cart Page

Show discount pricing info in cart.

![Info - Cart Page](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-Info-Cart-Page.png)

Available placeholders:

- `%qty%`,
- `%qty_total%`,
- `%old_price_single%`,
- `%old_price_total%`,
- `%new_price_single%`,
- `%new_price_total%`,
- `%discount_value%`,
- `%discount_percent%`,
- `%discount_single%`,
- `%discount_total%`.

**Item price**
: : Default: `no`

**Item price template**
: If "Item price" option is enabled, set template here.

: Default:

```
<del>%old_price_single%</del> %new_price_single%<br>You save: <span style="color:red;">%discount_percent%%</span>
```

**Item subtotal**
: : Default: `no`

**Item subtotal template**
: If "Item subtotal" option is enabled, set template here.

: Default:

```
<del>%old_price_total%</del> %new_price_total%<br>You save: <span style="color:red;">%discount_total%</span>
```

### Info: Discount Pricing Table

Show discount pricing table on single product pages.

![Info - Discount Pricing Table](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-Info-Discount-Pricing-Table.png)

 You can also display wholesale pricing info anywhere on your site with `[alg_wc_wholesale_pricing_table]`, `[alg_wc_product_wholesale_pricing_table]`, `[alg_wc_wholesale_pricing_data]`, `[alg_wc_product_wholesale_pricing_data]` [shortcodes](#shortcodes).

**Single product page**
: : Default: `no`

**Template for non-variable products**
: For example:

```
[alg_wc_product_wholesale_pricing_table table_format="vertical" heading_format="from %level_min_qty% pcs." price_row_format="%new_price_single%"]
```

: Default:

```
[alg_wc_product_wholesale_pricing_table]
```

**Template for variable products**
: For example:

```
[alg_wc_product_wholesale_pricing_table table_format="vertical" heading_format="from %level_min_qty% pcs." price_row_format="%new_price_single%"]
```

: Default: *None*

**Template for variations**
: Available placeholders: `%variation_id%`.
 For example:

```
[alg_wc_product_wholesale_pricing_table product_id="%variation_id%" table_format="horizontal" price_row_format="<del>%old_price_single%</del> %new_price_single%"]
```

: Default:

```
[alg_wc_product_wholesale_pricing_table product_id="%variation_id%"]
```

**Hide main variable table on visible variation**
: Will automatically hide main variable product pricing table, when variation table becomes visible.

: Default: `no`

### Info: Replace Price

Replace standard product price display with a discounted one.
 For example: from `$7,00` to `From $5,00 for 10 pcs.`

![Info - Replace Price](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-Info-Replace-Price.png)

**Single product page**
: : Default: `no`

**Template for single product pages**
:

: Default:

```
[alg_wc_product_wholesale_pricing_data field="price" level_num="1" product_id="%product_id%"]
```

**Shop page**
: : Default: `no`

**Template for shop pages**
:

: Default:

```
[alg_wc_product_wholesale_pricing_data field="price" level_num="1" product_id="%product_id%"]
```

### Price Display by Quantity

This section allows you to display product price by quantity in real-time, i.e. when a customer changes product quantity on a single product page.

![Price Display by Quantity](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-Price-Display-by-Quantity.png)

**Price display by quantity**
: : Default: `no`

**Template (no discount)**
: Price display by quantity template for quantities with no discount. Available placeholders:

- `%qty%`,
- `%old_price_single%`,
- `%old_price_total%`.

: Default:

```
%old_price_total% for %qty% pcs.
```

**Template**
: Price display by quantity template for quantities with discount. Available placeholders:

- `%qty%`,
- `%old_price_single%`,
- `%old_price_total%`,
- `%new_price_single%`,
- `%new_price_total%`,
- `%discount_value%`,
- `%discount_percent%`,
- `%discount_single%`,
- `%discount_total%`.

: Default:

```
<del>%old_price_total%</del> %new_price_total% for %qty% pcs. You save: <span style="color:red;">%discount_percent%%</span>
```

**Position**
: Price display by quantity position on the frontend. Possible values: Instead of the price; Before the price; After the price.

: Default: `Instead of the price`

**Refresh interval**
: In milliseconds.

: Default: `500`

**Variable products**
: Will display price by quantity in variation price section. Ignored if it's not a variable product, or if variation prices are the same.

: Default: `yes`

**Force standard quantity input**
: Enable this if you are using non-standard quantity input (e.g. dropdown), and having issues with the price display by quantity.

: Default: `no`

### Dropdown

This section allows you to replace standard quantity input with a dropdown. Dropdown values will be equal to the min quantities of the wholesale pricing levels.

**Dropdown**
: : Default: `no`

![Wholesale Pricing for WooCommerce - Quantity Dropdown](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-Quantity-Dropdown.png)

**Dropdown label template**
: Available placeholders:

- `%qty%`,
- `%qty_total%`,
- `%old_price_single%`,
- `%old_price_total%`,
- `%new_price_single%`,
- `%new_price_total%`,
- `%discount_value%`,
- `%discount_percent%`,
- `%discount_single%`,
- `%discount_total%`.

: Default: `%qty%`

**Dropdown class**
: HTML class for the `select` element.

: Default: `qty`

**Dropdown style**
: HTML style for the `select` element.
 E.g.: `min-width:100px;`

: Default: *None*

**HTML before**
: Optional HTML outputted before the `select` element.
 E.g.: `<table><tbody><tr><th>Quantity</th><td>`

: Default: *None*

**HTML after**
: Optional HTML outputted after the `select` element.
 E.g.: `</td></tr></tbody></table>`

: Default: *None*

**Filter values**
: Filter dropdown values using product's step, min and max values.

: Default: `no`

### Advanced Options

These settings are applied to the [All Products](#section-all-products) section only.

![Advanced Options](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-Advanced-Options.png)

**Required products**
: Ignored if empty.

: Default: *None*

**Excluded products**
: : Default: *None*

### Tools

Check the box and save changes to run the tool. **Please note that there is no undo for these actions.**

![Wholesale Pricing for WooCommerce - Tools](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-Tools.png)

**Delete per product settings**
: Will delete all **per product** wholesale pricing settings.

: Default: `no`

**Delete per term settings**
: Will delete all **per product category** and **per product tag** wholesale pricing settings.

: Default: `no`

### Shortcodes

#### `[alg_wc_wholesale_pricing_table]`

Displays *global (i.e. not per product)* wholesale pricing table.

##### Attributes

- **heading_format** - sets format for the table headings. Replaced values: `%level_min_qty%` and `%level_max_qty%`.
   Default value:
  ```
  from %level_min_qty% pcs.
  ```
- **before_level_max_qty** - used only if `%level_max_qty%` is included in **heading_format**.
   Default value:
  ```
  -
  ```
- **last_level_max_qty** - used only if `%level_max_qty%` is included in **heading_format**.
   Default value:
  ```
  +
  ```
- **hide_if_zero_quantity** - hides table row (`yes`) if level quantity is set to zero.
   Default value:
  ```
  no
  ```
- **table_format** - can be `horizontal` or `vertical`.
   Default value:
  ```
  horizontal
  ```

##### Example

```
[alg_wc_wholesale_pricing_table heading_format="%level_min_qty%%level_max_qty% pcs."]
```

##### Output

![Wholesale Pricing for WooCommerce - Shortcodes - Global Wholesale Pricing Table Example](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-Shortcodes-Global-Wholesale-Pricing-Table-Example.png)

#### `[alg_wc_product_wholesale_pricing_table]`

Displays *product's* wholesale pricing table.

##### Attributes

- **heading_format** - sets the format for the table headings. Replaced values: `%level_min_qty%` and `%level_max_qty%`.
   Default value:
  ```
  from %level_min_qty% pcs.
  ```
- **before_level_max_qty** - used only if `%level_max_qty%` is included in **heading_format**.
   Default value:
  ```
  -
  ```
- **last_level_max_qty** - used only if `%level_max_qty%` is included in **heading_format**.
   Default value:
  ```
  +
  ```
- **hide_if_zero_quantity** - hides table row (`yes`) if level quantity is set to zero.
   Default value:
  ```
  no
  ```
- **table_format** - can be `horizontal` or `vertical`.
   Default value:
  ```
  horizontal
  ```
- **hide_currency** - hides currency symbol (`yes`).
   Default value:
  ```
  no
  ```
- **add_price_row** - adds price row to the table.
   Default value:
  ```
  yes
  ```
- **price_row_format** - used only if **add_price_row** is set to `yes`.
   Default value:
  ```
  <del>%old_price%</del> %price%
  ```
- **add_percent_row** - adds percent row to the table (`yes`). Ignored unless "Discount type" is set to "Percent".
   Default value:
  ```
  no
  ```
- **add_discount_row** - adds discount row to the table (`yes`). Ignored unless "Discount type" is set to "Fixed".
   Default value:
  ```
  no
  ```
- **columns_styles** - cells HTML *style* attribute.
   Default value:
  ```
  text-align: center;
  ```
- **table_class** - table HTML *class* attribute.
   Default value:
  ```
  None
  ```
- **product_id** - optional product ID. If not set - will use the current product.
   Default value:
  ```
  Current product's ID
  ```

##### Example

```
[alg_wc_product_wholesale_pricing_table add_percent_row="yes"]
```

##### Output

![Wholesale Pricing for WooCommerce - Shortcodes - Product Wholesale Pricing Table Example](https://wpfactory.com/wp-content/uploads/Wholesale-Pricing-for-WooCommerce-Shortcodes-Product-Wholesale-Pricing-Table-Example.png)

#### `[alg_wc_wholesale_pricing_data]`

Displays *global (i.e. not per product)* wholesale pricing data.

##### Attributes

- **field** - can be `discount` or `quantity`.
   Default value:
  ```
  discount
  ```
- **level_num** - can be `last` or actual level number.
   Default value:
  ```
  last
  ```

##### Example

```
Best deal: [alg_wc_wholesale_pricing_data level_num="last" field="discount"]% discount for [alg_wc_wholesale_pricing_data level_num="last" field="quantity"]+ pieces!
```

##### Output

Best deal: 19% discount for 30+ pieces!

#### `[alg_wc_product_wholesale_pricing_data]`

Displays *product's* wholesale pricing data.

##### Attributes

- **field** - can be `price`, `discount` or `quantity`.
   Default value:
  ```
  price
  ```
- **price_format** - used only if the **field** is set to `price`.
   Default value:
  ```
  <del>%old_price%</del> %price%
  ```
- **hide_currency** - hides currency symbol (`yes`). Used only if the **field** is set to `price`.
   Default value:
  ```
  no
  ```
- **level_num** - can be `last` or actual level number.
   Default value:
  ```
  last
  ```
- **product_id** - optional product ID. If not set - will use the current product.
   Default value:
  ```
  Current product's ID
  ```

##### Example

```
Lowest price: [alg_wc_product_wholesale_pricing_data field="price" price_format="%price%" level_num="last"] for [alg_wc_product_wholesale_pricing_data field="quantity" level_num="last"] pcs.
```

##### Output

Lowest price: €98.01 for 30 pcs.
