Forked from JeroenSormani/woocommerce-store-wide-disable-sales.php
Created
August 17, 2016 17:14
-
-
Save iamra/afcc01fad122689b51ddb1aa13846764 to your computer and use it in GitHub Desktop.
WC disable sale on all products.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Disable all sales. | |
* | |
* A simple function to disable all the sales in the shop. | |
* Uncomment the line of code to disable the sale price on products. | |
*/ | |
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_get_sale_price', 'custom_wc_get_sale_price', 50, 2 ); | |
add_filter( 'woocommerce_get_price', 'custom_wc_get_sale_price', 50, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment