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
- Dynamic Pricing – Creates discount rules
- Global Content Blocks – Creates content blocks which you can print using a shortcode
- WooCommerce Custom Product Tabs Lite – Add the support for a custom tab on the single product page – See also the premium version of this plugin.
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:
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:
After creating it, be sure to copy the shortcode of the content block from Settings > Global Content Blocks:
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:
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):
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:
Leave a Reply