Create a Dynamic Pricing Discount table in the product page

As you know, Dynamic Pricing does not print a discount table in the single product page. This is due to the complexity of the discount rules you can create which makes impossible for the plugin to create a discount table.

But you can still do it manually. You will learn how to do this here using two free plugins with Dynamic Pricing.

Requirements

How to create the discount table

Be sure to have all the three plugins installed ad active.

The first thing you need to do is to create a discount rule for some products. In this example I’ll do it only on one product. I configured it like this:

Dynamic pricing rules

Then you need the content block to print in the product tab.

Go to Settings > Global Content Blocks and create a new content block like this one:

Global content block

After creating it, be sure to copy the shortcode of the content block from Settings > Global Content Blocks:

Global content block shortcode

and go to your product admin page in Products > All Products > Edit a product.

With WooCommerce Custom Product Tabs Lite you will now have a new tab in the section Product Data named Custom Tab. This tab will allow you to create a new product tab specifying a title and the content.

In this example I used Discounts for the title, and the Global Content Blocks shortcode for the content:

Custom tab content

Going to the product single page you will see a new tab named Discounts with the table of discounts. It should look like this (using Storefront):

Discount table on Storefront

WordPress does not have the table buttons in the editor, you will need to create the HTML code for the table manually. Here is the HTML used for this tutorial:


More Posts That You Might Like…


12 responses to “Create a Dynamic Pricing Discount table in the product page”

  1. Hi Nicola. Thanks for this very useful post. It’ll be perfect for an commerce site I’m building that supports both Wholesale and Retail customers. I have a question though… suppose I want show or hide these elements based on user type? How can I hide them from retail customers and make them visible to wholesale customers?

    1. Hi David, thanks for reading!

      You can use Groups with its shortcodes. It allows you to hide/show contents based on the user role/group.

  2. So this discount table is hard-coded, which is NOT sync with the real pricing, right? How can I do it to make it change automatically on the front-end after I change the real pricing in the back-end?

    1. Hi John,
      Yes, it is hard-coded. If you want an automatic one you can use this plugin.

  3. any way to show the prices on product page?

  4. i mean directly next to “put int cart” its the law in germany :/

    1. Hi Maz,
      you should use one of those plugins for the German market. They make WooCommerce reliable for the German law about eCommerce.

      You can find one here: https://wordpress.org/plugins-wp/woocommerce-germanized/

      There are others if you Google “WooCommerce German Market”.

  5. Hi, the plugin Global Content Blocks is no longer available, do you have another suggestion for implementing this?

  6. […] 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. […]

  7. Hello Nicola,
    Great way to show a price table on the product page.
    Is there a piece of code to show the product name in the table. I mean, I have variable products and the price tables show, but there is no way to figure out for the customer which product the price table is for.
    Kind regards,

    1. Hi Marianne,
      since the table is manually created you can simply add a title before it in the content editor.

      I think that would be the best and fastest way.

  8. […] 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. […]

Leave a Reply

Categories

Newsletter

Receive new articles from this blog directly in your inbox!

No spam guaranteed!

Blog at WordPress.com.

%d bloggers like this: