Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This code works fine for single products.
- function my_custom_wc_single_price_discount() {
- global $product;
- $discount = 10; // 10% off
- $price = $product->get_price();
- $new_price = $price - ( $product->get_price() / 100 ) * $discount;
- echo '<p>' . sprintf( __( '<strong>%s</strong> (%s de desconto) no boleto bancário.' ), wc_price( $new_price ), $discount . '%' ) . '</p>';
- }
- add_action( 'woocommerce_single_product_summary', 'my_custom_wc_single_price_discount', 11 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement