mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
8 lines
528 B
Text
8 lines
528 B
Text
function custom_wc_get_sale_price( $sale_price, $product ) {
|
|
// return $product->get_regular_price(); // Un-comment this to disable all sale prices
|
|
return $sale_price;
|
|
}
|
|
add_filter( 'woocommerce_product_get_sale_price', 'custom_wc_get_sale_price', 50, 2 );
|
|
add_filter( 'woocommerce_product_get_price', 'custom_wc_get_sale_price', 50, 2 );
|
|
// add_filter( 'woocommerce_get_sale_price', 'custom_wc_get_sale_price', 50, 2 ); // WC < 3.1.2
|
|
// add_filter( 'woocommerce_get_price', 'custom_wc_get_sale_price', 50, 2 ); // WC < 3.1.2
|