• Resolved magole

    (@magole)


    The price for the Bundle product is counted correctly and it is the sum of all bundled products.
    The problem is with the price at the top of the product page. It ranges from the lowest to the highest price. For the Bundled Product, it is zero here, not the sum counted correctly a little later.
    In this example, it is $0.00 – $14.04. But it should be $2.64 – $14.04. There is only one bundled product on this page, the one with a price $2.64.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Roxy

    (@roxannestoltz)

    Hi @magole ,

    Thanks for reaching out!

    As I understand, the price range displayed on the product page is not reflecting the correct price range for bundled products, is this correct?

    Please could you clarify how you are enabling Product bundles on your site, as this is not a built-in feature of WooCommerce core. Are you perhaps using this Product Bundles extension?

    If yes, since this is related to a premium extension, please contact us directly at WooCommerce.com → My Account → Support. You will need to log in to the account which was used to purchase the extension.

    As per the forum guidelines, no support for premium extensions is done here but we will be happy to assist you further from there ??

    On the other hand, if you are not using this exact extension on your site, please could you let us know which plugin you are using to enabled this on your site.

    Cheers!

    Thread Starter magole

    (@magole)

    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;
    }
    Roxy

    (@roxannestoltz)

    Hi @magole ,

    Thanks for sharing your and your friends findings with us ??

    If you would like any further help with or clarity surrounding this, I’d suggest reaching out to us directly here. Also, you can include a link to this forum thread.

    Hope this helps!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘$0 price problem with Grouped product containing Bundle products’ is closed to new replies.