Call to undefined function wc_empty_cart()
-
Hello,
WooCommerce Payments plugin is generating an unhandled exception on our website: “Call to undefined function wc_empty_cart()”
The error only occurs once or twice a day on a well trafficked site, so it is not easy to reproduce. But I am including the stack trace below so you can review the issue. From the stack trace you can see that WooCommerce plugin is loaded, but the function wc_empty_cart is not available, so perhaps there is a timing issue regarding when initialize_session() can be called?
fatal_handlerUncaught Error: Call to undefined function wc_empty_cart() in /wp-content/plugins/woocommerce/includes/class-wc-session-handler.php:372 Stack trace: #0 /wp-content/plugins/woocommerce/includes/class-wc-session-handler.php(363): WC_Session_Handler->forget_session() #1 /wp-content/plugins/woocommerce/includes/class-wc-session-handler.php(99): WC_Session_Handler->destroy_session() #2 /wp-content/plugins/woocommerce/includes/class-wc-session-handler.php(71): WC_Session_Handler->init_session_cookie() #3 /wp-content/plugins/woocommerce/includes/class-woocommerce.php(861): WC_Session_Handler->init() #4 /wp-content/plugins/woocommerce-payments/includes/multi-currency/MultiCurrency.php(913): WooCommerce->initialize_session() #5 /wp-content/plugins/woocommerce-payments/includes/multi-currency/MultiCurrency.php(614): WCPay\MultiCurren
- The topic ‘Call to undefined function wc_empty_cart()’ is closed to new replies.