Last active
January 27, 2016 17:46
-
-
Save funkysoul/7215b1f5edc2207fd129 to your computer and use it in GitHub Desktop.
Woocommerce Snippet on how to change the variation price so it only displays the lowest
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
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('Ab ', '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