Home › Forums › WoodMart support forum › From price for variation product › Reply To: From price for variation product
thomas-8605
Install fresh wordpress.
Install elementor.
Install woocommerce.
Install storefront theme.
Adding this snippet to functions.php into child folder:
// Ab vor dem Variantenpreis einfügen. Quelle: GermanMarket Support.
add_filter( ‘woocommerce_variable_price_html’, function( $price_string, $variable_product ){
if ( $variable_product->get_variation_price( ‘min’ ) != $variable_product->get_variation_price( ‘max’ ) ) {
$price_string = ‘ab ‘ . wc_price( $variable_product->get_variation_price( ‘min’ ) ) . $variable_product->get_price_suffix();
}
return $price_string;
}, 10, 2 );
And voila – you can see the word \”Ab\” like prefix.
But if you enable woodmart now in wordpress the word \”ab\” is hidden by woodmart css.
You can check my screenshot from previous message and you will see the following css came from woodmart:
.hide-larger-price .price {
word-spacing: -1em;
visibility: hidden;
}
BR
Tommy