WooCommerce is an excellent plugin which made WordPress an wonderful E-Commerce platform, You can implement almost any kind of E-Commerce store using it and its super easy to manage than any other dedicated E-Commerce platform available today.
One good way to increase your sales is announcing a discount/offer on products, In WooCommerce you can easily set that by mentioning two different prices while creating the product page. If the discount is set WooCommerce by default displays a sale bubble on individual products page and in category pages. Usually the bubble sounds dumb it just says something like “Save!” or any other term which is surely boring.
So what I have here is a code snippet to calculate individual product discount and display it in sale bubble. Replace all the codes in following files
your theme folder/woocommerce/loop/sale-flash.php and
your theme folder/woocommerce/single-product/sale-flash.php with below code.
Now lets style the bubble, Copy the following CSS codes to your theme’s style.css file
Thats it you just added a cool feature which has potential to increase your sales.
Good thing about this code is even if your product is variant type (multiple type of single product) and has different percentage of offers for different variants then this code will take the best percentage out of the all variants and displays it. For example you have 3 product variant each has three different percentage 3%,4%,1% then it will display 4% in sales bubble.
Isn’t that cool ? Go on now.