Fix: Argument #1 ($object_or_class) must be of type object|string
-
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)
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.