Home Forums WoodMart support forum variation product price show zero Reply To: variation product price show zero

#567935

Hello,

Please remove the previous code add the below code to the functions.php file in the Child theme:

function custom_pric_sale_price_html( $price, $product ) {
    if ( $product->is_on_sale() ) {
        $regular_price = wc_get_price_to_display( $product, array( 'price' => $product->get_regular_price() ) );
        $sale_price = wc_get_price_to_display( $product, array( 'price' => $product->get_sale_price() ) );
        $price = '<del>' . wc_price( $regular_price ) . '</del> <br> <ins>' . wc_price( $sale_price ) . '</ins>';
    }
    return $price;
}
add_filter( 'woocommerce_get_price_html', 'custom_pric_sale_price_html', 10, 2 );

Best Regards.