Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
WooCommerce - Disable ALL sale prices with code
* After adding this code to theme functions.php, ensure you clear transients via WC > System Status > Tools
add_filter( 'woocommerce_get_sale_price', '__return_empty_string' );
add_filter( 'woocommerce_variation_prices_sale_price', '__return_empty_string' );
add_filter( 'woocommerce_variation_prices_price', 'custom_get_price', 10, 2 );
add_filter( 'woocommerce_get_price', 'custom_get_price', 10, 2 );
function custom_get_price( $price, $product ) {
if ( $product->is_type( 'variable' ) ) {
$prices = $product->get_variation_prices();
return min( $prices['regular_price'] );
} else {
return $product->get_regular_price();
Copy link

vincealvare commented Sep 19, 2019

This worked perfectly on WC v3.6.5. Thanks Mike!!

Copy link

hotpt commented Mar 14, 2020

Do you know a way to hide the sale price on the single product page only?

Copy link

Selina-fk commented Dec 10, 2020

Hi, the code does not work in the cart, how can I disable it in the whole store?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment