we are seeing the following fatal error in our PHP logs:
[18-Jun-2021 09:27:46 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_cart_total() on null in /web/app/themes/aurum/inc/laborator_functions.php:1374 Stack trace: #0 /web/app/themes/aurum/tpls/header-top-bar.php(79): aurum_show_top_menu_widget() #1 /web/wp/wp-includes/template.php(732): require('...') #2 /web/wp/wp-includes/template.php(676): load_template() #3 /web/wp/wp-includes/general-template.php(204): locate_template() #4 /web/app/themes/aurum/tpls/header.php(18): get_template_part() #5 /web/wp/wp-includes/template.php(732): require('...') #6 /web/wp/wp-includes/template.php(676): load_template() #7 /web/wp/wp-includes/general-template.php(204): locate_template() #8 /web/app/themes/aurum/header in /web/app/themes/aurum/inc/laborator_functions.php on line 1374
Aurum 3.10, WC 5.3.0 and WP 5.7.2
We don't know what to do to reproduce it and hope these are not affecting customers in any ugly ways (payment/confirmation for example) but would like you to be noticed so that the problem could be quickly fixed.
I have tried the same plugin version but this error is not shown! Are you sure you have WooCommerce activated because this error would be thrown if WooCommerce is not active, in that case only.
If you still encounter this issue can you please send me your WP credentials so I can check where is the problem.
To include your credentials click Insert Credentials button in editor toolbar. (See how)
Of course WC is activated and working. (We even collected successfully [all?] orders)
This error is thrown because WooCommerce is active but Arum is using `cart->get_cart_total()` with its `aurum_show_top_menu_widget()` function calls by a template which seems frequently (if not always) loaded (`header.php`) what probably leads to run code even when the `cart` is null. (Problematic codepath? Missing check?)
Unfortunately, we can't grant you the access to our instance but here are some occurrences of the issue, showing that it's not an isolated case:
Dears,
we are seeing the following fatal error in our PHP logs:
[18-Jun-2021 09:27:46 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_cart_total() on null in /web/app/themes/aurum/inc/laborator_functions.php:1374
Stack trace:
#0 /web/app/themes/aurum/tpls/header-top-bar.php(79): aurum_show_top_menu_widget()
#1 /web/wp/wp-includes/template.php(732): require('...')
#2 /web/wp/wp-includes/template.php(676): load_template()
#3 /web/wp/wp-includes/general-template.php(204): locate_template()
#4 /web/app/themes/aurum/tpls/header.php(18): get_template_part()
#5 /web/wp/wp-includes/template.php(732): require('...')
#6 /web/wp/wp-includes/template.php(676): load_template()
#7 /web/wp/wp-includes/general-template.php(204): locate_template()
#8 /web/app/themes/aurum/header in /web/app/themes/aurum/inc/laborator_functions.php on line 1374
Aurum 3.10, WC 5.3.0 and WP 5.7.2
We don't know what to do to reproduce it and hope these are not affecting customers in any ugly ways (payment/confirmation for example) but would like you to be noticed so that the problem could be quickly fixed.
Hi animalequality,
I have tried the same plugin version but this error is not shown! Are you sure you have WooCommerce activated because this error would be thrown if WooCommerce is not active, in that case only.
If you still encounter this issue can you please send me your WP credentials so I can check where is the problem.
To include your credentials click Insert Credentials button in editor toolbar. (See how)
Hi Arlind, and thank you for the reply.
Of course WC is activated and working. (We even collected successfully [all?] orders)
This error is thrown because WooCommerce is active but Arum is using `cart->get_cart_total()` with its `aurum_show_top_menu_widget()` function calls by a template which seems frequently (if not always) loaded (`header.php`) what probably leads to run code even when the `cart` is null. (Problematic codepath? Missing check?)
Unfortunately, we can't grant you the access to our instance but here are some occurrences of the issue, showing that it's not an isolated case:
[12-Jun-2021 14:47:29
[16-Jun-2021 11:04:40
[16-Jun-2021 11:04:49
[18-Jun-2021 09:27:46
[18-Jun-2021 09:27:57
[23-Jun-2021 23:30:15
[23-Jun-2021 23:30:15
[30-Jun-2021 14:15:19
[30-Jun-2021 14:15:20
Hi AE,
Thats totally fine with access. I will try to solve this issue by giving you an enhanced version of the file that throws this error.
Download this file and replace it in this directory (of the theme): /aurum/inc/
What I've done I have added an extra check for WC()->cart and then call the method get_cart_total() if the cart is initialized.
Can you please try this and see if any error will be thrown in few days.
Sorry for the wait.