-
-
Save ofernandolopes/def783bd8c28b4447e9ad77d0da65cd8 to your computer and use it in GitHub Desktop.
WooCommerce - Definir uma promoção para toda a loja
This file contains 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 | |
add_filter( 'woocommerce_product_get_sale_price', 'fa_custom_sale_price', 10, 2 ); | |
add_filter( 'woocommerce_product_get_price', 'fa_custom_sale_price', 10, 2 ); | |
function fa_custom_sale_price( $sale_price, $product ) { | |
return $product->get_regular_price() * 0.5; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment