You must have access to files that need to be modified to show the sale percentage in woocommerce :
Woocommerce files :
- -> /—/wp-content/plugins/woocommerce/templates/loop/sale-flash.php
- -> /—/wp-content/plugins/woocommerce/templates/single-product/sale-flash.php
Step 1 :
Find the file : sale-flash.php

Step 2 :
Open and edit the file : sale-flash.php

Step 3 :
Add this code and comment the original :
<?php if($product->regular_price > 0){ $percentage = round( ( ( $product->regular_price - $product->sale_price ) / $product->regular_price ) * 100 ); if($percentage < 100){ echo apply_filters( 'woocommerce_sale_flash', '<span class="onsale">' . __( $percentage . '%', 'woocommerce' ) . '</span>', $post, $product ); } } ?>

Do the same for both files. If you have Cache Plugins , clear the cache to see the change.
With Percentage :

Without Percentage :

Leave A Comment