• Resolved Brian Henry

    (@brianhenryie)


    WPC Product Bundles for WooCommerce (Premium). Error: "Uncaught TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given in /path/to/wp-content/plugins/woo-product-bundle-premium/includes/class-woosb.php:1506
    Stack trace:
    #0 /path/to/wp-content/plugins/woo-product-bundle-premium/includes/class-woosb.php(1506): method_exists(Array, 'get_product')
    #1 /path/to/wp-includes/class-wp-hook.php(309): WPCleverWoosb->cart_item_visible(true, Array)
    #2 /path/to/wp-includes/plugin.php(189): WP_Hook->apply_filters(true, Array)
    #3 /path/to/wp-content/themes/enhanced/templates/cart.php(34): apply_filters('woocommerce_car...', true, Array, '6a4aaf5a1a4e7da...')
    #4 /path/to/wp-includes/template.php(772): require('/chroot/home/ab...')
    #5 /path/to/wp-includes/template.php(716): load_template('/chroot/home/ab...', false, Array)
    #6 /path/to/wp-includes/general-template.php(204): locate_template(Array, true, false, Array)
    #7 /path/to/wp-content/themes/enhanced/base.php(27): get_template_part('templates/cart')
    #8 /path/to/wp-includes/template-loader.php(106): include('/chroot/home/ab...')
    #9 /path/to/wp-blog-header.php(19): require_once('/chroot/home/ab...')
    #10 /path/to/index.php(17): require('/chroot/home/ab...')
    #11 {main}
    thrown" at 2022-05-23T18:13:13Z UTC.

    Change includes/class-woosb.php:1507 from:

    if ( method_exists( $cart_item, 'get_product' ) ) {

    to:

    if ( is_object( $cart_item ) && method_exists( $cart_item, 'get_product' ) ) {

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi @brianhenryie,

    Thank you for reporting the issue to us!

    We’ll fix the error immediately and release the new update 6.2.3 today.
    We’ll inform you as soon as our latest version is published

    Regards,`

    21stcenturyessentials

    (@21stcenturyessentials)

    @miemie
    Hi,

    Has this issue been fixed. I downloaded version 6.5.2 today and got a similar error.

    Error Details
    =============
    An error of type E_ERROR was caused in line 82 of the file /home2/shoppka6/public_html/kylwintoys/wp-content/plugins/woo-product-bundle/includes/class-product.php. Error message: Uncaught TypeError: Unsupported operand types: string * float in /home2/shoppka6/public_html/kylwintoys/wp-content/plugins/woo-product-bundle/includes/class-product.php:82
    Stack trace:
    #0 /home2/shoppka6/public_html/kylwintoys/wp-content/plugins/woocommerce/includes/tracks/events/class-wc-products-tracking.php(229): WC_Product_Woosb->get_sale_price()
    #1 /home2/shoppka6/public_html/kylwintoys/wp-includes/class-wp-hook.php(307): WC_Products_Tracking->track_product_published(3559, Object(WP_Post), true, Object(WP_Post))
    #2 /home2/shoppka6/public_html/kylwintoys/wp-includes/class-wp-hook.php(331): WP_Hook->apply_filters('', Array)
    #3 /home2/shoppka6/public_html/kylwintoys/wp-includes/plugin.php(476): WP_Hook->do_action(Array)
    #4 /home2/shoppka6/public_html/kylwintoys/wp-includes/post.php(5393): do_action('wp_after_insert...', 3559, Object(WP_Post), true, Object(WP_Post))
    #5 /home2/shoppka6/public_html/kylwintoys/wp-includes/post.php(4687): wp_after_insert_post(Object(WP_Post), true, Object(WP_Post))
    #6 /home2/shoppka6/public_html/kylwintoys/wp-includes/post.php(4775): wp_insert_post(Array, false, true)
    #7 /home2/shoppka6/public_html/kylwintoys/wp-admin/includes/post.php(426): wp_update_post(Array)
    #8 /home2/shoppka6/public_html/kylwintoys/wp-admin/post.php(227): edit_post()
    #9 {main}
      thrown
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Fix: Argument #1 ($object_or_class) must be of type object|string’ is closed to new replies.