1

My site url is this https://hang.systemedic.nl in shop page when i select any of item and select its size and then click add to cart button a fatal error is occurred here is the complete error

Fatal error: Uncaught Error: Call to a member function getUserWholesaleRole() on null in /home/hangsystemedic/public_html/wp-content/plugins/frame-calculator/main.php:48 Stack trace: #0 /home/hangsystemedic/public_html/wp-includes/class-wp-hook.php(307): FrameCalculator->addCartItemData(Array, 2616, '2618') #1 /home/hangsystemedic/public_html/wp-includes/plugin.php(189): WP_Hook->apply_filters(Array, Array) #2 /home/hangsystemedic/public_html/wp-content/plugins/woocommerce-product-bundles/includes/class-wc-pb-cart.php(887): apply_filters('woocommerce_add...', Array, 2616, '2618') #3 /home/hangsystemedic/public_html/wp-content/plugins/woocommerce-product-bundles/includes/class-wc-pb-cart.php(1271): WC_PB_Cart->bundled_add_to_cart(2617, Object(WC_Product_Variable), 1, '2618', Array, Array) #4 /home/hangsystemedic/public_html/wp-includes/class-wp-hook.php(307): WC_PB_Cart->bundle_add_to_cart('9677411b71f9d10...', 2617, 1, '2618', Array, Array) #5 /home/hangsystemedic/public_html/wp-includes/class-wp-hook.php(331): WP_Hook->a in /home/hangsystemedic/public_html/wp-content/plugins/frame-calculator/main.php on line 48

Can anyone please help me to fix this out for the size I am using frame calculator pluign?

M. Eriksson
  • 13,450
  • 4
  • 29
  • 40
  • 1
    You should always include the relevant code. Also read [How to create a Minimal, Reproducible Example](https://stackoverflow.com/help/minimal-reproducible-example) and [how to ask](https://stackoverflow.com/help/how-to-ask). You should also [take the tour](https://stackoverflow.com/tour) that was recommended to you when you registered. However, the error is very clear. You're trying to use a variable that contains "null" as if it were an object. – M. Eriksson Feb 25 '22 at 07:35
  • the error is self explanatory you just need to check if value is not null before calling function. – Aqib Javed Feb 25 '22 at 07:36
  • Here is the page where error is occurring https://hang.systemedic.nl/shop/ophang-profielen/ophang-fotopaneel-profiel-hrp-15a-aluminium-geanodiseerd/ – Muhammad Bilal Feb 25 '22 at 07:40
  • Posting a link to your site doesn't help us. This is a PHP error so we need to see the PHP code you're calling that causes the error. – M. Eriksson Feb 25 '22 at 07:45
  • here is code of main.php from line 46 to 50 $product_variation = wc_get_product($variation_id); $user_wholesale_role = $wc_wholesale_prices->wwp_wholesale_roles->getUserWholesaleRole(); if(!empty($user_wholesale_role)) { – Muhammad Bilal Feb 25 '22 at 07:56
  • So `$wc_wholesale_prices->wwp_wholesale_roles` is not an object. – M. Eriksson Feb 25 '22 at 08:57

0 Answers0