Skip to content

Instantly share code, notes, and snippets.

@lmartins
Created May 13, 2015 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmartins/1041dec602ab5f4568d2 to your computer and use it in GitHub Desktop.
Save lmartins/1041dec602ab5f4568d2 to your computer and use it in GitHub Desktop.
Customize variable woocommerce products price range label
/*
* Personalizar apresentacao do price range de produto
* para produtos variaveis
*/
add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2);
function custom_variation_price( $price, $product ) {
$price = '';
if ( !$product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) $price .= '<span class="from">' . _x('From', 'min_price', 'woocommerce') . ' </span>';
$price .= woocommerce_price($product->min_variation_price);
return $price;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment