when I click “Edit page” on the cart or checkout page, a critical error occurs
-
Hello,
After logging in as an administrator, when I click “Edit page” on the cart or checkout page, a critical error occurs. The error message is as follows:
Uncaught Error: Call to a member function needs_shipping() on null in /***/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-express-checkout-helper.php:606
-
Hi @mamekichi
Thanks for reaching out and providing the error details. The error message you’re seeing suggests there’s a problem with the Stripe payment gateway plugin where it’s trying to call a function named
needs_shipping()
on an object that doesn’t exist (that’s what “on null” means). This kind of error typically happens when the plugin expects a certain piece of data to be there and it’s not. It could also be a plugin conflict with the Stripe payment gateway.To move forward:
- Check for updates to the WooCommerce and Stripe plugins to ensure you’re using the latest versions.
- Try disabling any recent plugins you’ve added, as they can sometimes cause unexpected issues like this
- If you’re comfortable with it and you have recent backups, you could also temporarily switch to a default theme like Twenty Twenty-One to rule out any plugin/theme conflicts.
If the problem continues, please let us know about any recent changes you’ve made to your site or any new plugins you’ve installed. A system status report would also help us check your site’s setup and identify other possible causes. You can find it by going to WooCommerce → Status, clicking Get system report, and then selecting Copy for Support.
Thank you for the detailed explanation. I was unable to reproduce the problem while changing various settings. I would like to close this case for now. Thank you very much.
I have identified the conditions that cause the crash.
If you try to edit the “classic checkout page” while only the twe plugins Stripe, Woocommerce are enabled, it will crash. It crashes in both storefront and twenty-five themes.
It does not crash when trying to edit Checkout Blocks.Hi there!
I understand your concern. I tried replicating the issue on my test site but was unable to reproduce it.
Here’s what I did:
- I created a new page and added the classic checkout to it.
- Set the newly created page as the checkout page.
- Kept only the Stripe for WooCommerce plugin and WooCommerce active, then attempted to edit the page.
I did not encounter the issue, as shown in this screenshot: https://prnt.sc/i6o3CTUP6-1o.
It seems like there might be a setting or configuration on your site causing the issue. To assist you further, I’d like to better understand your site’s setup. Please share with us the necessary information below for us to investigate the issue further:
- System Status Report which you can find via WooCommerce > Status > Get system report > Copy for support.
- Fatal error logs (if any) under WooCommerce > Status > Logs.
Once we have more information, we’ll be able to assist you further.
Some parts have been removed for security reasons. Furthermore, when I replaced it with version 8.8.2, no error occurred. A similar error occurred with the latest version 9.0.0.
2024-12-13T07:07:48+00:00 CRITICAL Uncaught Error: Call to a member function needs_shipping() on null in /***/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-express-checkout-helper.php:606 CONTEXT: {"error":{"type":1,"file":"/***/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-express-checkout-helper.php","line":606},"remote-logging":true,"backtrace":["","#0 /***/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-blocks-support.php(288): WC_Stripe_Express_Checkout_Helper->should_show_express_checkout_button()","#1 /***/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-blocks-support.php(197): WC_Stripe_Blocks_Support->should_show_express_checkout_button()","#2 /***/wp-content/plugins/woocommerce/src/Blocks/Payments/PaymentMethodRegistry.php(62): WC_Stripe_Blocks_Support->get_payment_method_data()","#3 /***/wp-content/plugins/woocommerce/src/Blocks/Payments/Api.php(92): Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry->get_all_registered_script_data()","#4 /***/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Payments\Api->add_payment_method_script_data()","#5 /***/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()","#6 /***/wp-includes/plugin.php(517): WP_Hook->do_action()","#7 /***/wp-content/plugins/woocommerce/src/Blocks/BlockTypes/Cart.php(265): do_action()","#8 /***/wp-content/plugins/woocommerce/src/Blocks/BlockTypes/AbstractBlock.php(110): Automattic\WooCommerce\Blocks\BlockTypes\Cart->enqueue_data()","#9 /***/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock->enqueue_editor_assets()","#10 /***/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()","#11 /***/wp-includes/plugin.php(517): WP_Hook->do_action()","#12 /***/wp-admin/edit-form-blocks.php(302): do_action()","#13 /***/wp-admin/post.php(187): require('...')","#14 {main}","thrown"]}
WordPress Environment
**
**
WC Version: 9.4.3
Legacy REST API Package Version: The Legacy REST API plugin is not installed on this site.
Action Scheduler Version: ✔ 3.8.2
Log Directory Writable: ✔
WP Version: 6.7.1
WP Multisite: –
WP Memory Limit: 1 GB
WP Debug Mode: –
WP Cron: ✔
Language: en_US
External object cache: – Server Environment
Server Info: Apache
PHP Version: 8.3.12
PHP Post Max Size: 2 GB
PHP Time Limit: 300
PHP Max Input Vars: 1000
cURL Version: 7.61.1
OpenSSL/1.1.1k
SUHOSIN Installed: –
MySQL Version: 10.6.19-MariaDB
Max Upload Size: 2 GB
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔ Database
WC Database Version: 9.4.3
WC Database Prefix: luckybeans_
Total Database Size: 43.19MB
Database Data Size: 34.33MB
Database Index Size: 8.86MB Post Type Counts
attachment: 587
customize_changeset: 2
custom_css: 14
elementor_library: 3
hoot_slider: 1
inspire_invoice: 1
jetpack_migration: 2
jp_img_sitemap: 1
jp_sitemap: 1
jp_sitemap_master: 1
language_switcher: 4
mailpoet_page: 1
ml-slide: 5
ml-slider: 3
mycred_rank: 1
nav_menu_item: 34
ni-order-status: 1
page: 26
post: 560
product: 153
product_variation: 130
revision: 49
seedprod: 2
shop_coupon: 7
shop_order: 943
shop_order_refund: 10
sliced_invoice: 1
store: 1
tribe_events: 3
tribe_organizer: 1
tribe_venue: 2
wcps: 2
wcs_ruleset: 1
wc_order_email: 3
wc_order_status: 1
wfwp_wc_order_status: 1
woocarousel: 1
wpcf7_contact_form: 1
wpplugin_don_button: 1
wp_global_styles: 9
wp_navigation: 7
wp_template: 13
wp_template_part: 12
wysijap: 1
yaymail_template: 11
yith_wcps_type: 2 Security
Secure connection (HTTPS): ✔
Hide errors from visitors: ✔ Active Plugins (2)
WooCommerce: by Automattic – 9.4.3
Wordfence Security: by Wordfence – 8.0.1 Inactive Plugins (34) Settings
Legacy API Enabled: –
Force SSL: –
Currency: JPY (¥)
Currency Position: left
Thousand Separator: ,
Decimal Separator: .
Number of Decimals: 0
Taxonomies: Product Types: external (external)
grouped (grouped)
simple (simple)
variable (variable)
Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)
Connected to WooCommerce.com: ✔
Enforce Approved Product Download Directories: –
HPOS feature enabled: ✔
Order datastore: Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore
HPOS data sync enabled: ✔ Logging
Enabled: ✔
Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2
Retention period: 7 days
Level threshold: –
Log directory size: 3 KB WC Pages
Shop base: #4 - /shop/
Cart: #10275 - /cart/ - This page's content is overridden by custom template content
Checkout: #12452 - /classic-checkout-page/ - This page's content is overridden by custom template content
My account: #1715 - /my-account/
Terms and conditions: ❌ Page visibility should be public Theme
Name: Twenty Twenty-Five
Version: 1.0
Author URL: https://ja.wordpress.org
Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme
WooCommerce Support: ❌ Not declared Templates
Overrides: //wp-content/plugins/woocommerce/templates/block-notices/error.php //wp-content/plugins/woocommerce/templates/block-notices/notice.php
/***/wp-content/plugins/woocommerce/templates/block-notices/success.php Admin
Enabled Features: activity-panels
analytics
product-block-editor
coupons
core-profiler
customize-store
customer-effort-score-tracks
import-products-task
experimental-fashion-sample-products
shipping-smart-defaults
shipping-setting-tour
homescreen
marketing
mobile-app-banner
navigation
onboarding
onboarding-tasks
pattern-toolkit-full-composability
product-custom-fields
remote-inbox-notifications
remote-free-extensions
payment-gateway-suggestions
printful
shipping-label-banner
subscriptions
store-alerts
transient-notices
woo-mobile-welcome
wc-pay-promotion
wc-pay-welcome-page
launch-your-store
Disabled Features: product-data-views
experimental-blocks
minified-js
product-pre-publish-modal
settings
async-product-editor-category-field
product-editor-template-system
blueprint
reactify-classic-payments-settings
use-wp-horizon
Daily Cron: ✔ Next scheduled: 2024-12-14 07:12:59 +09:00
Options: ✔
Notes: 14
Onboarding: completed Action Scheduler
Complete: 248
Oldest: 2024-11-12 21:16:54 +0900
Newest: 2024-12-13 16:21:29 +0900
Failed: 203
Oldest: 2023-02-17 09:11:27 +0900
Newest: 2024-12-10 13:32:28 +0900
Pending: 5
Oldest: 2024-12-13 16:39:51 +0900
Newest: 2025-01-07 06:20:37 +0900 Status report information
Generated at: 2024-12-13 16:21:35 +09:00
`The status report shown above was without stripe enabled. Here is the status report when stripe is enabled.
WordPress Environment<br><br>WordPress address (URL): ****<br>Site address (URL): ****<br>WC Version: 9.4.3<br>Legacy REST API Package Version: The Legacy REST API plugin is not installed on this site.<br>Action Scheduler Version: ✔ 3.8.2<br>Log Directory Writable: ✔<br>WP Version: 6.7.1<br>WP Multisite: –<br>WP Memory Limit: 1 GB<br>WP Debug Mode: –<br>WP Cron: ✔<br>Language: en_US<br>External object cache: – Server Environment<br><br>Server Info: Apache<br>PHP Version: 8.3.12<br>PHP Post Max Size: 2 GB<br>PHP Time Limit: 300<br>PHP Max Input Vars: 1000<br>cURL Version: 7.61.1<br>OpenSSL/1.1.1k<br><br>SUHOSIN Installed: –<br>MySQL Version: 10.6.19-MariaDB<br>Max Upload Size: 2 GB<br>Default Timezone is UTC: ✔<br>fsockopen/cURL: ✔<br>SoapClient: ✔<br>DOMDocument: ✔<br>GZip: ✔<br>Multibyte String: ✔<br>Remote Post: ✔<br>Remote Get: ✔ Database<br><br>WC Database Version: 9.4.3 Post Type Counts<br><br>attachment: 587<br>custom_css: 14<br>elementor_library: 3<br>hoot_slider: 1<br>inspire_invoice: 1<br>jetpack_migration: 2<br>jp_img_sitemap: 1<br>jp_sitemap: 1<br>jp_sitemap_master: 1<br>language_switcher: 4<br>mailpoet_page: 1<br>ml-slide: 5<br>ml-slider: 3<br>mycred_rank: 1<br>nav_menu_item: 34<br>ni-order-status: 1<br>page: 26<br>post: 560<br>product: 153<br>product_variation: 130<br>revision: 49<br>seedprod: 2<br>shop_coupon: 7<br>shop_order: 943<br>shop_order_refund: 10<br>sliced_invoice: 1<br>store: 1<br>tribe_events: 3<br>tribe_organizer: 1<br>tribe_venue: 2<br>wcps: 2<br>wcs_ruleset: 1<br>wc_order_email: 3<br>wc_order_status: 1<br>wfwp_wc_order_status: 1<br>woocarousel: 1<br>wpcf7_contact_form: 1<br>wpplugin_don_button: 1<br>wp_global_styles: 9<br>wp_navigation: 7<br>wp_template: 13<br>wp_template_part: 12<br>wysijap: 1<br>yaymail_template: 11<br>yith_wcps_type: 2 Security<br><br>Secure connection (HTTPS): ✔<br>Hide errors from visitors: ✔ Active Plugins (4)<br><br>WooCommerce Stripe ゲートウェイ: by Stripe – 9.0.0<br>WooCommerce: by Automattic – 9.4.3<br>Wordfence Security: by Wordfence – 8.0.1<br>WP Rollback: by WP Rollback – 2.0.7 Settings<br><br>Legacy API Enabled: –<br>Force SSL: –<br>Currency: JPY (¥)<br>Currency Position: left<br>Thousand Separator: ,<br>Decimal Separator: .<br>Number of Decimals: 0<br>Taxonomies: Product Types: external (external)<br>grouped (grouped)<br>simple (simple)<br>variable (variable)<br><br>Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)<br>exclude-from-search (exclude-from-search)<br>featured (featured)<br>outofstock (outofstock)<br>rated-1 (rated-1)<br>rated-2 (rated-2)<br>rated-3 (rated-3)<br>rated-4 (rated-4)<br>rated-5 (rated-5)<br><br>Connected to WooCommerce.com: ✔<br>Enforce Approved Product Download Directories: –<br>HPOS feature enabled: ✔<br>Order datastore: Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore<br>HPOS data sync enabled: ✔ Logging<br><br>Enabled: ✔<br>Handler: Automattic\WooCommerce\Internal\Admin\Logging\LogHandlerFileV2<br>Retention period: 7 days<br>Level threshold: –<br>Log directory size: 8 KB WC Pages<br><br>Shop base: #4 - /shop/<br>Cart: #10275 - /cart/ - This page's content is overridden by custom template content<br>Checkout: #12452 - /classic-checkout-page/ - This page's content is overridden by custom template content<br>My account: #1715 - /my-account/<br>Terms and conditions: ❌ Page visibility should be public Theme<br><br>Name: Twenty Twenty-Five<br>Version: 1.0<br>Author URL: https://ja.wordpress.org<br>Child Theme: ❌ – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme<br>WooCommerce Support: ❌ Not declared Templates<br><br>Overrides: /<strong><em>/plugins/woocommerce/templates/block-notices/error.php /</em></strong>/wp-content/plugins/woocommerce/templates/block-notices/notice.php<br>/***/wp-content/plugins/woocommerce/templates/block-notices/success.php Admin<br><br>Enabled Features: activity-panels<br>analytics<br>product-block-editor<br>coupons<br>core-profiler<br>customize-store<br>customer-effort-score-tracks<br>import-products-task<br>experimental-fashion-sample-products<br>shipping-smart-defaults<br>shipping-setting-tour<br>homescreen<br>marketing<br>mobile-app-banner<br>navigation<br>onboarding<br>onboarding-tasks<br>pattern-toolkit-full-composability<br>product-custom-fields<br>remote-inbox-notifications<br>remote-free-extensions<br>payment-gateway-suggestions<br>printful<br>shipping-label-banner<br>subscriptions<br>store-alerts<br>transient-notices<br>woo-mobile-welcome<br>wc-pay-promotion<br>wc-pay-welcome-page<br>launch-your-store<br><br>Disabled Features: product-data-views<br>experimental-blocks<br>minified-js<br>product-pre-publish-modal<br>settings<br>async-product-editor-category-field<br>product-editor-template-system<br>blueprint<br>reactify-classic-payments-settings<br>use-wp-horizon<br><br>Daily Cron: ✔ Next scheduled: 2024-12-14 07:12:59 +09:00<br>Options: ✔<br>Notes: 14<br>Onboarding: completed Action Scheduler<br><br>Complete: 251<br>Oldest: 2024-11-12 21:16:54 +0900<br>Newest: 2024-12-13 18:27:52 +0900<br><br>Failed: 203<br>Oldest: 2023-02-17 09:11:27 +0900<br>Newest: 2024-12-10 13:32:28 +0900<br><br>Pending: 5<br>Oldest: 2024-12-13 19:27:52 +0900<br>Newest: 2025-01-07 06:20:37 +0900 Status report information<br><br>Generated at: 2024-12-13 18:32:29 +09:00<br>
Hi @mamekichi,
Thank you for sharing the detailed information and error logs. From what you’ve described, it appears the crash might be caused by an uninitialized cart during the editing of the “classic checkout page.” While I’ve tried replicating the issue on my end with the same setup, I couldn’t reproduce the error.
To narrow down the cause, I recommend:
1. Confirm if the cart is empty when editing the page. If so, try adding a product to the cart to see if this resolves the issue.
2. Clear all transients via WooCommerce > Status > Tools > Clear transients and clear all site/server-level caches.
3. Clear WooCommerce sessions by going to WooCommerce > Status > Tools > Clear all sessions.
4. If possible, create a staging site and attempt to recreate the issue there under minimal conditions.
Additionally, if the issue persists, switching to Checkout Blocks may serve as a temporary solution while we investigate further.
Let us know how it goes!
Hi @mahfuzurwp
Methods 1, 2, and 3 that you taught me failed. However, I discovered a way that doesn’t cause an error.
There are two ways to display “Classic Checkout”. One is to select and place an icon labeled “Classic Checkout” from the block menu, and the other is to select and place an icon labeled “Shortcode” and write [woocommerce_checkout]. I found that the latter method doesn’t cause the error.
For now, I’ve managed to do what I wanted to do.
Thank you!Hello mamekichi,
Thank you for your reply.
I understand you’ve resolved the issue, and I appreciate you sharing the solution here.
Please don’t hesitate to contact us again if you have more questions or concerns.
We are here to help 🙂Have a great day!
- The topic ‘when I click “Edit page” on the cart or checkout page, a critical error occurs’ is closed to new replies.