Skip to content

Instantly share code, notes, and snippets.

@zarankumar
Created October 3, 2015 18:12
Show Gist options
  • Save zarankumar/5cadf479c2303aa041b7 to your computer and use it in GitHub Desktop.
Save zarankumar/5cadf479c2303aa041b7 to your computer and use it in GitHub Desktop.
Woocommerce set sale price to regular price - 15% discount
function so_31493236_sale_price( $sale_price, $product ) {
$sale_price = $product->get_regular_price() * 0.15;
return $sale_price;
}
add_filter( 'woocommerce_get_sale_price', 'so_31493236_sale_price', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment