WooCommerce Dynamic Pricing

Dynamic Pricing lets you define pricing rules based on products, order totals, roles, and product categories.

Installation ↑ Back to top

  1. Download the .zip file from your WooCommerce account.
  2. Go to: WordPress Admin > Plugins > Add New and Upload Plugin with the file you downloaded with Choose File.
  3. Install Now and Activate the extension.

More information at: Install and Activate Plugins/Extensions.

Overview ↑ Back to top

Dynamic Pricing has 7 modes available for creating and applying pricing rules for your store.

7 modes ↑ Back to top

Single products pricing – pricing based on and applied to quantity of individual product
1. Advanced product pricing: Bulk
2. Advanced product pricing: Special Offer

Orders pricing – pricing based on and applied to amount in cart
3. Advanced order totals pricing

Roles pricing – pricing based on user role and applied to amount in cart
4. Simple role pricing

Categories pricing – pricing based on and applied to product categories
5. Simple product category pricing
6. Advanced product category pricing: Bulk
7. Advanced product category pricing: Special offer

The other terms are explained here:

  • Simple means that the rule applies to all items, no matter how many are purchased.
  • Advanced means that the rule applies based on preset quantities:
    • For orders, those are the total price of the order
    • For products and categories, those are the amounts of items purchased
    • Bulk means that the rule is applied to all items under the rule
    • Special offer means that the rule only applies to a predefined amount, buy X and get Y discounted.

Examples ↑ Back to top

  • A simple role pricing of 10% off for all customers
    > will give 10% off to all items purchased by users who have the “customer” role.
  • A bulk advanced product category rule of $5 off for everyone and for the category “Albums” when 5-10 albums are bought
    > will give a discount of $5 per album bought if minimum 5 and maximum 10 are purchased.
  • A special offer product pricing of buying 1 hoodie and getting a second hoodie at 50%
    > will give a discount of 50% to the second hoodie only when paying the full price for the first one.

Single product pricing ↑ Back to top

Set up an advanced pricing rule for a specific product.

Go to: Product > Product X (the product you wish to set a rule for).

Next, go to: Product Data > Dynamic pricing.

Select Add Pricing Group.

There, configure the conditions for the rule.

  • Applies To: You can choose to apply this to ‘Everyone’, or to ‘Specific Roles’. Choosing ‘Specific Roles’ allows you to select the roles that the customer must be a member of for the rule to apply.
  • Quantities based on: 
    • Product Quantity: Quantities will be totaled based on the Product ID. If the product is a variable type product, this option will use each variation that has been added to the cart to calculate the total quantities, and will apply the price adjustment to all variations.
    • Variation Quantity: Quantities are totaled based on the Variation ID. The price adjustment is applied to the specific variation in the cart.
    • Cart Line Item Quantity: Quantities are based on the individual cart item. This is useful if you are using Product Add-ons or Gravity Forms to allow additional data to be added to the cart need to apply discounts to specific line items in the cart.
    • Quantity of Category: Selecting this option gives you the ability to select categories to use to build the price adjustment. This is useful if you would like to give a specific product a discount when X number of items from a product category have been added to the cart.
  • Rule Processing Mode: ‘Bulk’ will apply the rule on all items, ‘Special Offer’ to a predefined amount.
  • Dates: Define a date range for when the prices should be applied.

Finally, the table rates with the pricing rules need to be defined. These will differ slightly if you’ve chosen ‘Bulk’ or ‘Special Offer’.

  • Bulk
    • Minimum Quantity: This is the minimum amount that must be in the cart for the specific price adjustment to apply. Use 0 for the minimum quantity to force the discounted price to be displayed in the catalog before the user adds the item to the cart (since v. 1.3.1).
    • Max Quantity: Quantities in the cart must be less than or equal to this amount for the specific adjustment to apply. You can use an * to create an unlimited upper bound.
    • Type: The type of discount to apply. Price discount will discount by the exact amount you enter, percentage will discount by the percentage, and fixed price will fix the price ‘per item’ to what you enter.
    • Amount: The amount to discount.
  • Special Offer
    • Purchase: This is the amount of items the customer needs to purchase to get the discount.
    • Receive: This is the amount to which the discount should apply.
    • Type: The type of discount to apply. Price discount will discount by the exact amount you enter, percentage will discount by the percentage, and fixed price will fix the price of the item to what you enter.
    • Amount: The amount to discount.
    • Repeating: ‘No’ will only give this discount once, ‘Yes’ every time the rule is met.

The ‘+’ symbol at the end of each line in the table rate can be used to add more rules.

You can create several pricing groups per product. The rules will be evaluated from top to bottom; as soon as the rule is matched, the processing of other rules will stop.

Select Update to update your product.

dynamicpricing5

Order totals pricing ↑ Back to top

Set up an advanced pricing rule based on the total amount spent in the order.

Go to: WooCommerce > Dynamic Pricing > Order totals.

Select Add Pricing Group. You can create more than one group, allowing you to apply one set of criteria to a specific role, and another set of criteria to everyone else.

There, configure the conditions for the rule.

  • Admin Title: Give the group a title for the store manager. Customers will not see this.
  • Quantities based on: Select either “Cart Total” for the whole cart, or “Category Total” to select which categories need to be in the cart and which categories the discount is applied to.
  • Applies To: You can choose to apply this to Everyone, or to Specific Roles. Choosing Specific Roles allows you to select the roles that the customer must be a member of for the rule to apply.
  • Dates: Define a date range for when the prices should be applied.

Finally, the table rates with the pricing rules need to be defined.

  • Minimum Order Total: This is the minimum purchase amount in the cart to apply this rule.
  • Max Order Total: Maximum amount to apply this rule. You can use an * to create an unlimited upper bound.
  • Type: The only option here is ‘Percentage Discount’.
  • Amount: The amount to discount. Enter a number, like ’25’.

The ‘+’ symbol at the end of each line in the table rate can be used to add more rules.

Select Save Changes to enable the rule.

dynamicpricing6

Roles pricing ↑ Back to top

Set up a simple pricing rule based on someone’s user role.

Go to: WooCommerce > Dynamic Pricing > Roles.

There, you will see a list of all available roles on your store.

Toggle the Enabled switch to ‘Yes’ if you want to set up a discount for this role.

Choose a discount Type. Price Discount will discount by the exact amount you enter, and Percentage Discount will discount by the percentage.

Add an Amount. Use numbers only.

Finally, select Save Changes.

dynamicpricing1

Note: If you are looking to setup your own custom user roles it is best if you get a plugin to help with this. Groups is a popular option, as is User Role Editor.

Product category pricing ↑ Back to top

Product categories can be targeted as a whole with Dynamic Pricing. You’ll have the option to choose between ‘Category Pricing’ and ‘Advanced Category Pricing’.

Simple product category pricing ↑ Back to top

Set up a simple pricing rule based on the product category.

Go to: WooCommerce > Dynamic Pricing > Category.

In the Category Pricing tab, you’ll see all the product categories in your store.

Toggle the Enabled switch to ‘Yes’ if you want to set up a discount for this role.

Choose a discount Type. Price Discount will discount by the exact amount you enter, and Percentage Discount will discount by the percentage.

Add an Amount. Use numbers only.

Finally, select Save Changes.

If an item is in more than one category and both of those categories have discounts, the larger discount will be applied.

These rules will display in the store as though the item was on sale, by striking through the original price and adding the new category based price.

dynamicpricing2

Advanced product category pricing ↑ Back to top

Set up an advanced bulk pricing rule based on the quantities of categories in the cart.

Go to: WooCommerce > Dynamic Pricing > Category.

In the Advanced Category Pricing tab, no rules will be configured by default.

Select Add Category Pricing. You can create more than one group, allowing you to apply one set of criteria to a specific role, and another set of criteria to everyone else.

There, configure the conditions for the rule.

  • Admin Title: Give the group a title for the store manager. Customers will not see this.
  • Quantities based on: Select either ‘Cart Line Item Quantity’ for the amount of , or ‘Sum of Category’ to select which categories need to be in the cart and which categories the discount is applied to.
  • Categories: The pricing adjustment will be based on amounts from any of the selected categories. The product does not need to be in all of the selected categories, just one of them.
  • Applies To: You can choose to apply this to ‘Everyone’, or to ‘Specific Roles’. Choosing ‘Specific Roles’ allows you to select the roles that the customer must have for the rule to apply.
  • Rule Processing Mode: ‘Bulk’ will apply the rule on all items, ‘Special Offer’ to a predefined amount.
  • Categories to apply adjustment to: Choose what categories will be adjusted. This allows you to adjust prices of products outside the products that make up the quantity. So for instance, you can now create a rule that says, buy any 2 items from the menswear category, receive a 10% discount on items in the children’s category.
  • Dates: Define a date range for when the prices should be applied.

Finally, the table rates with the pricing rules need to be defined. These will differ slightly if you’ve chosen ‘Bulk’ or ‘Special Offer’.

  • Bulk
    • Minimum Quantity: This is the minimum quantity of the category that must be in the cart for the specific price adjustment to apply. Do not use the quantity of 0 here (there can’t be cero items in the cart).
    • Max Quantity: Quantities in the cart must be less than or equal to this amount for the specific adjustment to apply. You can use an * to create an unlimited upper bound.
    • Type: The type of discount to apply. ‘Price Discount’ will discount by the exact amount you enter, ‘Percentage’ will discount by the percentage, and ‘Fixed Price’ will fix the price of the item to what you enter.
    • Amount: The amount to discount.
  • Special Offer
    • Purchase: This is the quantity of items the customer needs to purchase at full amount to get the discount.
    • Receive: This is the quantity to which the discount should apply.
    • Type: The type of discount to apply. ‘Price Discount’ will discount by the exact amount you enter, ‘Percentage’ will discount by the percentage, and ‘Fixed Price’ will fix the price of the item to what you enter.
    • Discount Amount: The amount to use for the discount type.
    • Repeating: ‘No’ will only give this discount once, ‘Yes’ every time the rule is met.

The ‘+’ symbol at the end of each line in the table rate can be used to add more rules.

Select Save Changes to enable the rule.

dynamicpricing3

Example: Buy one, get one free

To offer one free album when a customer buys one album, use the following configuration:

  • Quantities based on: ‘Sum of Categories’
  • Categories: ‘Albums’
  • Applies to: ‘Everyone’
  • Rule Processing Mode: ‘Special Offer’
  • Dates: leave empty
  • Purchase: ‘1’
  • Receive: ‘1’
  • Discount Type: ‘Percentage Discount’
  • Discount Amount: ‘100’
  • Repeating: ‘Yes’ (this will give two albums free if they purchase two albums)

dynamicpricing8

If you want to apply this to a single product instead of a product category, then just edit that on the Dynamic Pricing tab of the individual product.

Formatting amounts ↑ Back to top

When entering values for prices for any rule:

  • If the decimal separator in your store is a comma (,), you must use a comma for decimal based discounts
  • Avoid the use of digit grouping delimiters; so use “1000” instead of “1,000”
  • Avoid the use of the % or currency indicators, these will be added automatically; so use “25” instead of “25%”

Debugging ↑ Back to top

If the prices are not showing as you expect when your customers get to the cart Dynamic Pricing provides debugging information. To enable this information you should edit your config.php and set WP_DEBUG to TRUE , see this link for more information on that: WordPress Codex Docs – WP Debug

Usage ↑ Back to top

Dynamic Pricing does not add information about the active pricing to the Products, Cart and Checkout pages. That is something that has to be done manually, for example, by adding “Buy 2 and get 30% off” to the description of your product.

The only thing customers will see, is a difference in pricing. In the example below, with an order total of $10 or more, the customer gets 20% off.

dynamicpricing-customerview

FAQ ↑ Back to top

Does Dynamic Pricing apply when I manually change an order after it is submitted?

Dynamic Pricing rules are not re-applied if you make changes to the order manually. You’ll need to do the calculation and adjust the total cost of the order by hand.

Strange array in the cart

If you are seeing an array under each product in your cart from Dynamic Pricing then you have WordPress debug set to true. You will need to edit your config.php file and set WP_DEBUG to FALSE, see this link for more information on that: WordPress Codex Docs – WP Debug.

Additional discounts with coupons

The Dynamic Pricing extension does not have the ability to disable settings when using coupons, thus the coupon discount would be in addition to the Dynamic Pricing settings.

Network admins get all role discounts

By design, network admins are ‘every role’ in WordPress meaning pricing rules for roles will all apply to these users. This doesn’t affect customers.

Why do advanced rules not automatically show up on single products and in the catalog?

Since there are many ways in which an advanced rule can be triggered and these are dependent on the quantity of products in the cart, there is no practical way to calculate what and what not might apply to a particular customer when using advanced rules until the item has been added to the cart.

The most common approach to this, and the way that is used on most big box retailers, is to advertise the sale in the sidebar, banner or somewhere else on the site. The alternate approach is to use actions from WooCommerce to add a description to individual products or entire categories of products. See this quick example for an idea of where to get started: Creating a Dynamic Pricing Discount table in the product page.

My advanced category cumulative rules are not working properly

Advanced category rules can not be cumulative except in the situation where items from one advanced category rule conflict with the items in another advanced category rule.

For instance, purchase one item from category 1 and get one item from category 2 for free. Purchase 3 items from category 2 and receive one item from category 2 for free. These types of discounts are not common and support for them is not currently included in the extension.

Can I exclude sale items from Dynamic Pricing rules?

Note: If you are unfamiliar with code/templates and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our  Support Policy.

Yes you can add this to your theme functions.php file:

Can I set Dynamic Pricing rules for Product Bundles? If I choose Bulk Advanced Product rule, is the total quantity based on the sum of the number of products in the bundle?

The way Dynamic Pricing rules will be applied to a Product Bundle depends on the pricing setting for the bundle. If the Bundle has a General Price, then the Dynamic Pricing rules will apply as if this war one indivisible product.

If, instead you are pricing your bundled products individually, then the pricing rules will be applied to the individual products, not to the bundle.

In this case, for example Bulk Advanced Product rule will count the number of products included in your bundle.

For example, if you are selling a bundle that includes a total of 2 games and 2 books, Bulk Advanced Product rule will count that as 4 items.

I have a rounding issue on my order totals.

Dynamic Pricing uses the decimal place setting from WooCommerce settings to perform rounding. In order to calculate the total, you would need to configure the price to show 4 decimal places or more, since rounding it to two may not be working for you.

You will need to add the following code below to your functions.php file:

add_filter('woocommerce_dynamic_pricing_get_decimals', 'custom_woocommerce_dynamic_pricing_get_decimals');
function custom_woocommerce_dynamic_pricing_get_decimals($decimals) {
return 4;
}

Keep in mind that rounding to 4 decimal places but only showing 2 will result in an inconsistent display of the prices. If someone manually multiplies the displayed item total of 27.44 * 20 quantity they will get the 548.80 result, not the 548.73 that is actually being charged to the customer.

Does Dynamic Pricing always discount the cheapest product when using a special offer?

Yes, Dynamic Pricing checks the products in your cart and will always discount the cheapest product when using a special offer (e.g. “Buy one, get one free”).

What happens if I have already a free product in the cart and I’m using the “Buy One, Get One Free” offer?

If the offer is applicable, the cheapest product in the cart will be discounted – in this case, the free product. It would appear as if the offer had not been applied at all.

Questions & Support ↑ Back to top

Have a question before you buy? Please fill out this pre-sales form.

Already purchased and need some assistance? Get in touch with a Happiness Engineer via the Help Desk.

WooCommerce - the most customizable eCommerce platform for building your online business.

Back to the top