How to alter price HTML for Variable products using Dynamic Pricing and Discounts Plugin for WooCommerce?

Consider a scenario where you want to set custom price HTML for variable products on your WooCommerce store. You can do away with the default price HTML and set one of your choice. You can achieve this by using a simple code snippet with our Dynamic Pricing and Discounts Plugin for WooCommerce.

Following is a screenshot of a variable product with default price HTML:

WooCommerce Dynamic Pricing and Discounts - Default Price HTML

Default Price HTML

To change the price HTML, copy the following code snippet and paste it in the functions.php file of your respective website theme folder.

Once you have pasted the code snippet and updated the functions.php file, you can see the changes in the variable product’s page as shown below:

WooCommerce Dynamic Pricing and Discounts - Custom Price HTML

Custom Price HTML


To know more about the product, checkout Dynamic Pricing and Discounts Plugin for WooCommerce.

To know more about other features of the plugin, read product setting up article.

Or checkout documentation section for more related articles.

Comments (5)

  • Mary-Ann

    Is there a way to get the lowest priced discount to show up? For example, I have an item with a base price of $40, but if a customer orders over 50 items, the price drops to $35. I would love to be able to display “From $35”. Currently it shows the lowest regular price, not including any quantity discounts. Any help would be much appreciated!

    April 18, 2018 at 4:53 am
    • Ipshita

      Hi Mary,

      For variable products, if you have set up a product discount rule of either “Fixed Price” or “Percentage Discount”, the discounted price of $35 would be reflected in the product page once you add more than 50 items in the cart.
      Let me know how you have set up the discount rule.


      April 19, 2018 at 3:44 pm
  • jesspine

    This code does not work and broke single product page.

    November 5, 2017 at 6:27 pm
    • jesspine

      woocommerce version 3.2.3

      November 5, 2017 at 6:40 pm
    • Ipshita

      Hi Jesspine,

      Apologies for the inconvenience caused.
      We have just updated the snippet in the above article.
      I request you to replace the previous one with this updated one.

      Thanks & Regards,

      November 6, 2017 at 12:58 pm

Leave a Reply