Archived topic
Fatal error on woocommerce logs
3 replies · Started by Deniz Akay on May 19, 2020
Hi,
I'm getting the following error message on woocommerce error logs:
CRITICAL ../wp-content/plugins/gp-premium/woocommerce/functions/functions.php dosyasında 582 numaralı satırda Uncaught Error: Call to a member function is_empty() on null in ../wp-content/plugins/gp-premium/woocommerce/functions/functions.php:582
Stack trace:
#0 ../wp-includes/class-wp-hook.php(287): generatepress_wc_mobile_cart_link('')
#1 ../wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
#2 ../wp-includes/plugin.php(478): WP_Hook->do_action(Array)
#3 ../wp-content/themes/generatepress/inc/structure/navigation.php(31): do_action('generate_inside...')
#4 ../wp-content/themes/generatepress/inc/structure/navigation.php(139): generate_navigation_position()
#5 ../wp-includes/class-wp-hook.php(287): generate_add_navigation_after_header('')
I've got latest versions of Wp, Woo, GP and GP Premium installed.
Thanks!
Hi there,
Are you seeing any errors on the front-end, or is this just in the logs?
That line contains this code:
if ( ! WC()->cart->is_empty() ) {
$has_items = ' has-items';
}
That's the current best way to check if the cart is empty - your error looks like it's saying the WooCommerce WC() class doesn't exist.
Are you using any caching plugins/server caching?
It is just in the woo logs, I don't see any errors on front end.
And yes I'm using fastest cache plugin.
I'm assuming that the cache is preventing WooCommerce from fully initiating, so that class ends up not having any value.
We'll add some safeguards into GPP to prevent the errors in the logs.