ResolvedTheme Update Fatal Error in Woocommerce Cart
- This topic has 4 replies, 2 voices, and was last updated 2 years, 4 months ago by
tricia.
- AuthorPosts
- July 7, 2021 at 4:35 pm #30998
tricia
ParticipantNotifying you of a bug in your latest theme update. Explanation below:
Thanks for the update! I believe I\’ve tracked down the fatal error that matches the 500 errors you\’ve been seeing. The full error is below. The short of it is that it doesn\’t like the get_cart_contents_count() function being used in the theme.
[01-Jul-2021 12:43:52 UTC] PHP Fatal error: Uncaught Error: Call to a member function get_cart_contents_count() on null in /www/wp-content/themes/zass/incl/woocommerce-functions.php:808
Stack trace:
#0 /www/wp-content/themes/zass/header.php(202): zass_cart_link()
#1 /www/wp-includes/template.php(730): require_once(\’/www/wp-content…\’)
#2 /www/wp-includes/template.php(676): load_template(\’/www/wp-content…\’, true, Array)
#3 /www/wp-includes/general-template.php(48): locate_template(Array, true, true, Array)
#4 /www/wp-content/themes/zass/index.php(4): get_header()
#5 /www/wp-includes/template-loader.php(106): include(\’/www/wp-content…\’)
#6 /www/wp-blog-header.php(19): require_once(\’/www/wp-include…\’)
#7 /www/index.php(17): require(\’/www/wp-blog-he…\’)
#8 {main}
thrown in /www/wp-content/themes/zass/incl/woocommerce-functions.php on line 808
The Woocommerce documentation suggests a slightly different variation of code to get this working properly. However, this would be the theme developer\’s responsibility to make sure everything is working correctly.
Normally, I\’d recommend updating the theme to make sure the code is the latest and most compatible version, but it looks like the site already has the latest version. So, it would be best to take the error above and forward it to the theme developers. Hopefully, they have a fix available!July 7, 2021 at 4:46 pm #30999Althemist
KeymasterHi Tricia,
Could you please give us a bit more context? Exactly where do you get that error and when? After what kind of interaction? Trying to add product to cart or something else? Exactly where do you see that error? Somewhere in the front-end or in error log?
Also, if you give us temporary admin access to your site it would be much easier to diagnose the problem.
You can post the site url and admin credentials here. Just don’t forget to mark the “set as private reply” checkbox when sending sensitive data.
Best regards,
DimitarJuly 7, 2021 at 7:47 pm #31007tricia
ParticipantThis reply has been marked as private.July 7, 2021 at 7:54 pm #31009Althemist
KeymasterThis reply has been marked as private.July 7, 2021 at 8:13 pm #31010tricia
ParticipantThis reply has been marked as private. - AuthorPosts
You must be logged in and have valid license to reply to this topic.