[Plugin WooCommerce] Remove the 'From: $' on variable products
-
No one seemed to have an answer on how to remove the from price and from label off of the variation products. I got really fed up of the dead ends and took a sample hook to modify. Here is my hacked part, hopefully it helps you too.
Remember to stick it in your functions.php of your theme so the updates do not delete it! If you want nothing returned leave the
$warning = '<span class="warning"></span>';blank or end with nullreturn;/** * This code should be added to functions.php of your theme **/ add_filter('woocommerce_variable_price_html', 'custom_variation_price', 10, 2); function custom_variation_price( $price, $product ) { $warning = '<span class="warning">Make your selections below to see pricing.</span>'; $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->get_price()); if ( $product->max_variation_price && $product->max_variation_price !== $product->min_variation_price ) { $price .= '<span class="to"> ' . _x('to', 'max_price', 'woocommerce') . ' </span>'; $price .= woocommerce_price($product->max_variation_price); } return $warning; }
The topic ‘[Plugin WooCommerce] Remove the 'From: $' on variable products’ is closed to new replies.