• Resolved clb92

    (@clb92)


    After updating recently, we now get a fatal error:

    [03-Dec-2025 09:51:06 UTC] PHP Fatal error:  Uncaught TypeError: Unsupported operand types: string * float in /home/username/public_html/wp-content/plugins/woo-product-bundle/includes/class-product.php:134
    Stack trace:
    #0 /home/username/public_html/wp-content/plugins/woo-product-bundle/includes/class-product.php(197): WC_Product_Woosb->get_regular_price()
    #1 /home/username/public_html/wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-product.php(1700): WC_Product_Woosb->get_price()
    #2 /home/username/public_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php(723): WC_Product->is_purchasable()
    #3 /home/username/public_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php(764): wc_get_product_class()
    #4 /home/username/public_html/wp-content/plugins/woocommerce/templates/content-product.php(27): wc_product_class()
    #5 /home/username/public_html/wp-includes/template.php(816): require('/home/username/p...')
    #6 /home/username/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(285): load_template()
    #7 /home/username/public_html/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-products.php(667): wc_get_template_part()
    #8 /home/username/public_html/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-products.php(102): WC_Shortcode_Products->product_loop()
    #9 /home/username/public_html/wp-content/plugins/woocommerce/includes/class-wc-shortcodes.php(286): WC_Shortcode_Products->get_content()
    #10 /home/username/public_html/wp-includes/shortcodes.php(434): WC_Shortcodes::products()
    #11 [internal function]: do_shortcode_tag()
    #12 /home/username/public_html/wp-includes/shortcodes.php(273): preg_replace_callback()
    #13 /home/username/public_html/wp-content/themes/Divi-Child/functions.php(338): do_shortcode()
    #14 /home/username/public_html/wp-includes/shortcodes.php(434): mix_shortcode_better_related_products()
    #15 [internal function]: do_shortcode_tag()
    #16 /home/username/public_html/wp-includes/shortcodes.php(273): preg_replace_callback()
    #17 /home/username/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php(3122): do_shortcode()
    #18 /home/username/public_html/wp-includes/shortcodes.php(434): ET_Builder_Element->_render()
    #19 [internal function]: do_shortcode_tag()
    #20 /home/username/public_html/wp-includes/shortcodes.php(273): preg_replace_callback()
    #21 /home/username/public_html/wp-content/themes/Divi/includes/builder/main-structure-elements.php(3784): do_shortcode()
    #22 /home/username/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php(3441): ET_Builder_Column->render()
    #23 /home/username/public_html/wp-includes/shortcodes.php(434): ET_Builder_Element->_render()
    #24 [internal function]: do_shortcode_tag()
    #25 /home/username/public_html/wp-includes/shortcodes.php(273): preg_replace_callback()
    #26 /home/username/public_html/wp-content/themes/Divi/includes/builder/main-structure-elements.php(2274): do_shortcode()
    #27 /home/username/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php(3441): ET_Builder_Row->render()
    #28 /home/username/public_html/wp-includes/shortcodes.php(434): ET_Builder_Element->_render()
    #29 [internal function]: do_shortcode_tag()
    #30 /home/username/public_html/wp-includes/shortcodes.php(273): preg_replace_callback()
    #31 /home/username/public_html/wp-content/themes/Divi/includes/builder/main-structure-elements.php(1606): do_shortcode()
    #32 /home/username/public_html/wp-content/themes/Divi/includes/builder/class-et-builder-element.php(3441): ET_Builder_Section->render()
    #33 /home/username/public_html/wp-includes/shortcodes.php(434): ET_Builder_Element->_render()
    #34 [internal function]: do_shortcode_tag()
    #35 /home/username/public_html/wp-includes/shortcodes.php(273): preg_replace_callback()
    #36 /home/username/public_html/wp-includes/class-wp-hook.php(341): do_shortcode()
    #37 /home/username/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters()
    #38 /home/username/public_html/wp-content/themes/Divi/includes/builder/core.php(46): apply_filters()
    #39 /home/username/public_html/wp-content/themes/Divi/includes/builder/frontend-builder/theme-builder/frontend.php(347): et_builder_render_layout()
    #40 /home/username/public_html/wp-content/themes/Divi/includes/builder/frontend-builder/theme-builder/frontend.php(506): et_theme_builder_frontend_render_layout()
    #41 /home/username/public_html/wp-content/themes/Divi/includes/builder/frontend-builder/theme-builder/frontend-body-template.php(7): et_theme_builder_frontend_render_body()
    #42 /home/username/public_html/wp-includes/template-loader.php(125): include('/home/username/p...')
    #43 /home/username/public_html/wp-blog-header.php(19): require_once('/home/username/p...')
    #44 /home/username/public_html/index.php(17): require('/home/username/p...')
    #45 {main}
    thrown in /home/username/public_html/wp-content/plugins/woo-product-bundle/includes/class-product.php on line 134

    My temporary solution has been to change line 134 in class-product.php from

    $regular_price += $_product->get_regular_price() * (float) $item['qty'];

    to

    $regular_price += (float) $_product->get_regular_price() * (float) $item['qty'];

    In other words, add (float) in front of $_product.

    I’m not sure exactly what has changed, but the root of the problem seems to be your plugin not casting to float, perhaps relying on implicit typecasting?

    • This topic was modified 6 months, 1 week ago by clb92. Reason: Wording
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Janilyn T

    (@janilyn409)

    Hi @clb92 ,

    Our developers have just released a new update for our plugin. Please update to version 8.4.1 and clear the caches before checking again.

    Best regards.

    Thread Starter clb92

    (@clb92)

    Thanks @janilyn409

    I saw the update earlier today, and have installed it. I will mark this as resolved now.

    Plugin Support Janilyn T

    (@janilyn409)

    Hi @clb92 ,

    Thanks for your feedback.

    If you need our help again, feel free to contact us at any time.

    Best regards.

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

The topic ‘Fatal error: Unsupported operand types: string * float in class-product.php:134’ is closed to new replies.