Site icon Experience Wordpress Developer Online – Design Develop and Maintenance Support

WooCommerce : Product Sales Flash Badge

How to Remove Product Sales Flash Icon Badge in WooCommerce

Looking easy solution for How to get rid of Product Sales Flash Icon Badge in WooCommerce ?

Solution 1: Use Regular Price only.

During set price for Product Leave “Sale Price” field empty.

Solution 2. Use CSS to hide the icon.

With use of css display:none property set display none to css class which used for Product Sales Flash Icon Badge.

// Use below CSS code to hide sale badge, insert it to active theme style.css file. or from wp-admin custom css option !
.onsale {
    display: none !important;
}

Solution 3. Filter the “Sale” Icon Out Completely

The following is a simple filter code which return false; when WooCommerce calls for the Sale flash badge:
Place below code in your active theme function.php file and you should see the Sale flash icon badge no more visible.

//Remove Sales Flash
add_filter('woocommerce_sale_flash', 'woo_custom_hide_sales_flash');
function woo_custom_hide_sales_flash()
{
    return false;
}

Solution 4. Remove the action by use of remove_action

To remove Product Sales Flash Icon Badge in WooCommerce This method work sure and your sale badge get disappear. We suggest use this method only if the methods given above isn’t working for some reason. Reason for use this method in special case is with this method we removing the action completely which may break either theme woocommerce custom code or another plugin’s functionality if they ties into this action.

// Remove "Sale" icon badge from product archive page
remove_action( 'woocommerce_before_shop_loop_item_title', 'woocommerce_show_product_loop_sale_flash', 20 );

// Remove "Sale" icon from product single page
remove_action( 'woocommerce_before_single_product_summary', 'woocommerce_show_product_sale_flash', 20 );

Is it work for you?

We have tested this code with WordPress twentyseventeen theme and WooCommerce 3.3.1.
Please let us know in the comments if it work or not according your need. We are happy to update existing method and add new if you get it work with any other way.

Exit mobile version