Skip to content

Instantly share code, notes, and snippets.

@eltondev
Created July 2, 2015 17:38
Show Gist options
  • Save eltondev/9b0cb53010b598b8c913 to your computer and use it in GitHub Desktop.
Save eltondev/9b0cb53010b598b8c913 to your computer and use it in GitHub Desktop.
Custom text starting from WooCommerce
function variable_price_html_custom( $price, $product ) {
$price = '';
if ( ! $product->min_variation_price || $product->min_variation_price !== $product->max_variation_price ) {
$price .= '<span class="from">' . __( 'À partir de' ) . ' </span>';
}
$price .= woocommerce_price( $product->get_price() );
return $price;
}
add_filter( 'woocommerce_variable_price_html', 'variable_price_html_custom', 10, 2 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment