Skip to content

Instantly share code, notes, and snippets.

@ofernandolopes
Forked from fernandoacosta/functions.php
Created November 24, 2017 01:42
Show Gist options
  • Save ofernandolopes/def783bd8c28b4447e9ad77d0da65cd8 to your computer and use it in GitHub Desktop.
Save ofernandolopes/def783bd8c28b4447e9ad77d0da65cd8 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