Website Building » WooCommerce » How Do I Show Discount Percentage in WooCommerce?

How Do I Show Discount Percentage in WooCommerce?

Last updated on October 1, 2022 @ 10:39 pm

When you offer a sale or a discount on your WooCommerce store, you may want to show the percentage off to your customers. You can do this by editing the code in your theme, or by using a plugin.

To edit the code in your theme, you will need to access the file called loop-product-sale.php in your theme folder. If you are using a child theme, you will need to edit the file in the parent theme folder.

Once you have found this file, look for the line that says:

get_price_html(); ?>

You will need to replace this line with the following:

is_on_sale() ) : ?>

get_price_html(); ?>

This will show the percentage off next to the sale price on your product pages.

PRO TIP: If you are planning to show discount percentage in WooCommerce, be aware that this could potentially affect your sales. Some customers may feel like they are being tricked into thinking they are getting a better deal than they actually are. Others may feel like the discounts are not significant enough. Use caution when implementing this change, and be sure to test it thoroughly before making it live on your site.

If you want to style the text, you can use HTML tags like and . For example:

is_on_sale() ) : ?>

‘ . $product->get_price_html() . ‘‘; ?>

If you are using a plugin to show discounts on your WooCommerce store, there are a few things to keep in mind. First, make sure that the plugin is compatible with your version of WooCommerce.

Second, check reviews of the plugin to make sure that it is well-supported and works as advertised. Finally, test the plugin on a staging site before installing it on your live site.

Dale Leydon

Dale Leydon

Sysadmin turned Javascript developer. Owner of 20+ apps graveyard, and a couple of successful ones.