Cart crashes after deactivating plugin
-
Having an issue with my cart page not updating. I deactivated all plugins to try to resolve. When I deactivate the cart pdf plugin my cart crashes. When I uninstall the plugin same thing happens, cart crashes. I reinstalled plugin and cart came back up but still same issue with cart not updating and cannot process an order. Hard to troubleshoot cart issue when I can’t deactivate your plugin without crashing the cart.
The page I need help with: [log in to see the link]
-
So sorry to hear this is happening, can you trigger the error again that crashes the cart, and then look at the error.log within your Kinsta account and report back here with the error?
Hi David.
Log error:
2023/11/29 15:47:17 [error] 6033#6033: *283 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 2605:59c8:201d:4710:f447:1dc0:cc02:4fc2, server: staging-carnivaldepot.kinsta.cloud, request: “GET /cart/?kinsta-cache-cleared=true HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php8.0-fpm-carnivaldepot.sock:”, host: “staging-carnivaldepot.kinsta.cloud:21334”, referrer: “https://staging-carnivaldepot.kinsta.cloud/cart/”
2023/11/29 15:30:47 [error] 6033#6033: *224 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 2605:59c8:201d:4710:f447:1dc0:cc02:4fc2, server: staging-carnivaldepot.kinsta.cloud, request: “GET /wp-json/jetpack/v4/jitm?message_path=wp%3Aplugins%3Aadmin_notices&query=deactivate%253Dtrue%252Cplugin_status%253Dall%252Cpaged%253D1%252Cs%253D&full_jp_logo_exists=false&_wpnonce=a440056cae HTTP/2.0”, upstream: “fastcgi://unix:/var/run/php8.0-fpm-carnivaldepot.sock:”, host: “staging-carnivaldepot.kinsta.cloud:21334”, referrer: “https://staging-carnivaldepot.kinsta.cloud/wp-admin/plugins.php?plugin_status=all&paged=1&s”
Did you add any custom code that extends the WC Cart PDF plugin in your theme by chance? Deactivating this plugin by nature wouldn’t crash your cart unless there is some code relying on it somewhere.
I do have custom code for the pdf page in my child theme which my site normally runs on. I switch to my regular theme to try to diagnose a different issue.
Hmm ok. The errors above do not describe something related to the WC Cart PDF plugin crashing, thus preventing deactivation. I do see mention of the Jetpack plugin however. Can you try deactivating Jetpack and then WC Cart PDF after?
Sorry for the delay. Here is the latest error on the cart page.
Fatal error: Uncaught TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, function “wc_cart_pdf_button” not found or invalid function name in /www/carnivaldepot_424/public/wp-includes/class-wp-hook.php:324 Stack trace: #0 /www/carnivaldepot_424/public/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #1 /www/carnivaldepot_424/public/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #2 /www/carnivaldepot_424/public/wp-content/themes/flatsome/woocommerce/cart/cart.php(39): do_action(‘woocommerce_bef…’) #3 /www/carnivaldepot_424/public/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include(‘/www/carnivalde…’) #4 /www/carnivaldepot_424/public/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-cart.php(99): wc_get_template(‘cart/cart.php’) #5 /www/carnivaldepot_424/public/wp-content/plugins/woocommerce/includes/class-wc-shortcodes.php(72): WC_Shortcode_Cart::output(Array) #6 /www/carnivaldepot_424/public/wp-content/plugins/woocommerce/includes/class-wc-shortcodes.php(85): WC_Shortcodes::shortcode_wrapper(Array) #7 /www/carnivaldepot_424/public/wp-includes/shortcodes.php(433): WC_Shortcodes::cart(”, ”, ‘woocommerce_car…’) #8 [internal function]: do_shortcode_tag(Array) #9 /www/carnivaldepot_424/public/wp-includes/shortcodes.php(273): preg_replace_callback(‘/\\[(\\[?)(gap|wo…’, ‘do_shortcode_ta…’, ‘[gap]\n[woocomme…’) #10 /www/carnivaldepot_424/public/wp-includes/class-wp-hook.php(324): do_shortcode(‘[gap]\n[woocomme…’) #11 /www/carnivaldepot_424/public/wp-includes/plugin.php(205): WP_Hook->apply_filters(‘[gap]\n[woocomme…’, Array) #12 /www/carnivaldepot_424/public/wp-includes/post-template.php(256): apply_filters(‘the_content’, ‘[gap]\n\n[woocomm…’) #13 /www/carnivaldepot_424/public/wp-content/themes/flatsome/woocommerce/checkout/layouts/checkout.php(18): the_content() #14 /www/carnivaldepot_424/public/wp-includes/template.php(792): require(‘/www/carnivalde…’) #15 /www/carnivaldepot_424/public/wp-content/plugins/woocommerce/includes/wc-core-functions.php(284): load_template(‘/www/carnivalde…’, false) #16 /www/carnivaldepot_424/public/wp-content/themes/flatsome/page-cart.php(9): wc_get_template_part(‘checkout/layout…’, ”) #17 /www/carnivaldepot_424/public/wp-includes/template-loader.php(106): include(‘/www/carnivalde…’) #18 /www/carnivaldepot_424/public/wp-blog-header.php(19): require_once(‘/www/carnivalde…’) #19 /www/carnivaldepot_424/public/index.php(17): require(‘/www/carnivalde…’) #20 {main} thrown in /www/carnivaldepot_424/public/wp-includes/class-wp-hook.php on line 324
You will need to wrap your action/filter hook in a conditional to check if the function exists first, like this:
if ( function_exists( 'wc_cart_pdf_button' ) ) { // add_action( 'example_hook', 'wc_cart_pdf_button' ); // or other code that is leveraging wc_cart_pdf_button() function }
Thank you….I’m not a developer. Can I add this to my code snippet plugin?
You need to modify the custom code you have added as mentioned in one of your previous replies.
The only custom code I added was some html. That was added to the child theme not the main theme. If I activate them main theme the crash still occurs. Since I’m not sure where to put the code you sent should I just delete the html I added to the child theme. It’s been working fine for over a year with the html I added.
Is the HTML you modified in the cart-table.php template override, to change the output of the PDF?
- The topic ‘Cart crashes after deactivating plugin’ is closed to new replies.