Hello Roxy,
I’m using this one: https://woocommerce.com/products/product-bundles/
After a few hours of help, my friend almost corrected this problem by external function. But it is not working perfectly. Here is one of his functions, so you will see where is the problem:
add_filter( 'woocommerce_get_price_html', 'get_html_price_bbb', 10, 2 );
function get_html_price_bbb( $price,$product ) {
if ( $product->get_type()== 'bundle') {
$price = 0;
$regular = 0;
$x = 0;
$is_on_sale = false;
$price_suffix = '';
foreach ( $product->get_bundled_items() as $key => $value ) {
$regular_price = (float) get_post_meta( $value->item_data["product_id"], '_regular_price', true );
$price += ($value->get_price() * $value->item_data["quantity_default"]);
$regular += $regular_price * $value->item_data["quantity_default"];
if ( $value->is_on_sale() ) {
$is_on_sale = true;
}
}
if( $is_on_sale ) {
$priceHtml = sprintf("%01.2f", $price);
$price = wc_format_sale_price( wc_get_price_to_display( $product, array( 'price' => $regular ) ), wc_get_price_to_display( $product ) ) . $price_suffix;
} else {
$price = wc_price( wc_get_price_to_display( $product, array( 'price' => $price ) ) ) . $price_suffix;
}
}
return $price;
}