Internal server 500 error on Webhooks
-
Hi there,
Love this plugin – thank you π
I am having trouble with the Webhooks however on one particular website, they’re all failing with a server 500 error.
These are the logs:
2021-11-29T00:00:06+00:00 CRITICAL Uncaught Error: Call to a member function get_cart_contents_count() on null in /home/******/******/***.***.co.uk/www/wp-content/themes/***/***/woocommerce-cart-custom-data.php:153 Stack trace: #0 /home/******/******/***.***.co.uk/www/wp-includes/class-wp-hook.php(303): {closure}('') #1 /home/******/******/***.***.co.uk/www/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #2 /home/******/******/***.***.co.uk/www/wp-includes/plugin.php(470): WP_Hook->do_action(Array) #3 /home/******/******/***.***.co.uk/www/wp-settings.php(600): do_action('wp_loaded') #4 /home/******/******/***.***.co.uk/www/wp-config.php(124): require_once('/home/***/vh...') #5 /home/******/******/***.***.co.uk/www/wp-load.php(50): require_once('/home/***/vh...') #6 /home/******/******/***.***.co.uk/www/wp-cron.php(44): require_once('/home/***/vh...') #7 {main} t in /home/******/******/***.***.co.uk/www/wp-content/themes/***/***/woocommerce-cart-custom-data.php on line 153This isn’t a theme that I developed, but the part of the file it’s referring to is:
add_filter('wp_loaded', function () { if (!is_admin()) { *** if (WC()->cart->get_cart_contents_count() == 0) { WC()->session->__unset('cart_created_time'); } else { // items in cart. $cartCreatedTime = WC()->session->get('cart_created_time'); if (!$cartCreatedTime) { WC()->session->set('cart_created_time', time()); } } check_session(); } });I highlighted line 153 with ***.
Is this something you could help me with please?
Thanks so much.
The page I need help with: [log in to see the link]
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
The topic ‘Internal server 500 error on Webhooks’ is closed to new replies.