Skip to content

Instantly share code, notes, and snippets.

@fernandoacosta
Created November 24, 2017 01:17
Show Gist options
  • Save fernandoacosta/19f980db10a35bad0c9acb05a64d5560 to your computer and use it in GitHub Desktop.
Save fernandoacosta/19f980db10a35bad0c9acb05a64d5560 to your computer and use it in GitHub Desktop.
WooCommerce - Definir uma promoção para toda a loja
<?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