How to Display the Discount Percentage on the Sale Badge in WordPress WooCommerce website

Connect With Us In Our Social Media

Table of Contents

Post Intro

In this video, I’m going to show you how to display the discount percentage on the sale badge in WordPress WooCommerce with just a few lines of codes. This trick is really cool and is great for using on your new store that you’ve just launched!

Youtube Tutorial

Login To Access Code Snippet:

Post More Detail

Here are the steps to add a 100% badge discount on a product using PHP and a plugin called “Code Snippets”
1. Install the Code Snippets plugin on your WordPress website. This plugin allows you to add custom code snippets to your site without modifying the theme’s functions.php file
2. Go to “Snippets” from the WordPress dashboard, and click on the “Add New” button.
3. Give your snippet a name and paste the attached code and customize using attached css.
4. Select the option “Run snippet everywhere” or “Run snippet on specific pages”
5. Click on the “Save Changes” and “Activate” button.
6. Go to your website and check the product that you want to apply the 100% off badge, you should see the badge now.

Conclusion In summary

You can use the “woocommerce_sale_flash” filter hook to add a custom discount percentage on the sale badge for products in a WordPress WooCommerce website. This can be done by adding a code snippet to the functions.php file of your theme or using a plugin like “Code Snippets” to add the code. This can be useful to display the exact discount percentage on the sale badge, and make it more attractive to customers.

Search

Connect With Us In Our Social Media

S
U
B
S
C
R
I
B
E

Stay UpTo Date with Latest Post And news:

0
Would love your thoughts, please comment.x
()
x

Login To Access Code Snippet:

Stay UpTo Date with Latest Post And news: