Customize variable product price not working for all curency
-
hello there, i’m using your plugin and i put this code on my website in ordre to display “From xx” for the price for variable products :
add_filter( 'woocommerce_variable_sale_price_html', 'wpm_variation_price_format', 10, 2 ); add_filter( 'woocommerce_variable_price_html', 'wpm_variation_price_format', 10, 2 ); function wpm_variation_price_format( $price, $product ) { $min_price = $product->get_variation_price( 'min', true ); $max_price = $product->get_variation_price( 'max', true ); if ($min_price != $max_price){ $price = sprintf( __( 'From %1$s', 'woocommerce' ), wc_price( $min_price ) ); return $price; } else { $price = sprintf( __( '%1$s', 'woocommerce' ), wc_price( $min_price ) ); return $price; } }
Globaly this code is working BUT if i select curency like ARS for example, that’s not working and that display a range pricing (for variable product) that is ugly :
Maybe there is an hook from CURCY to used on my code or something else
regards
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.