Last active
August 10, 2016 19:57
-
-
Save claudiosanches/d0b405a5de74d0f47570 to your computer and use it in GitHub Desktop.
WooCommerce - Variable product with custom from price label
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
function custom_variable_price_html( $price, $product ) { | |
$price = ''; | |
if ( ! $product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) { | |
$price .= '<span class="from">' . __( 'A partir de' ) . ' </span>'; | |
} | |
$price .= woocommerce_price( $product->get_price() ); | |
return $price; | |
} | |
add_filter( 'woocommerce_variable_price_html', 'custom_variable_price_html', 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Para ajudar a galera, deve ser aplicado em functions.php (geralmente).
Procure por: // WooCommerce specified functions e em seguida adicione...