Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WooCommerce Stripe Plugin Causes Fatal Error on Checkout Page Backend #3858

Open
zain0ul0abiddin opened this issue Feb 7, 2025 · 2 comments

Comments

@zain0ul0abiddin
Copy link

zain0ul0abiddin commented Feb 7, 2025

Describe the bug
The WooCommerce Stripe plugin causes a critical error when accessing and editing the checkout page in the WordPress backend. The issue occurs specifically when using the Classic Checkout block, whereas using the [woocommerce_checkout] shortcode works without issues.

Error Log

[07-Feb-2025 17:09:49 UTC] PHP Fatal error:  Uncaught Error: Call to a member function needs_shipping() on null in /srv/htdocs/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-express-checkout-helper.php:629
Stack trace:
#0 /srv/htdocs/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-blocks-support.php(302): WC_Stripe_Express_Checkout_Helper->should_show_express_checkout_button()
#1 /srv/htdocs/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-blocks-support.php(197): WC_Stripe_Blocks_Support->should_show_express_checkout_button()
#2 /wordpress/plugins/woocommerce/9.6.1/src/Blocks/Payments/PaymentMethodRegistry.php(62): WC_Stripe_Blocks_Support->get_payment_method_data()
#3 /wordpress/plugins/woocommerce/9.6.1/src/Blocks/Payments/Api.php(92): Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry->get_all_registered_script_data()
#4 /wordpress/core/6.7.1/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\Payments\Api->add_payment_method_script_data('')
#5 /wordpress/core/6.7.1/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array)
#6 /wordpress/core/6.7.1/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#7 /wordpress/plugins/woocommerce/9.6.1/src/Blocks/BlockTypes/Cart.php(265): do_action('woocommerce_blo...')
#8 /wordpress/plugins/woocommerce/9.6.1/src/Blocks/BlockTypes/AbstractBlock.php(111): Automattic\WooCommerce\Blocks\BlockTypes\Cart->enqueue_data()
#9 /wordpress/core/6.7.1/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Blocks\BlockTypes\AbstractBlock->enqueue_editor_assets('')
#10 /wordpress/core/6.7.1/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#11 /wordpress/core/6.7.1/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#12 /wordpress/core/6.7.1/wp-admin/edit-form-blocks.php(302): do_action('enqueue_block_e...')
#13 /wordpress/core/6.7.1/wp-admin/post.php(187): require('/wordpress/core...')
#14 {main}
  thrown in /srv/htdocs/wp-content/plugins/woocommerce-gateway-stripe/includes/payment-methods/class-wc-stripe-express-checkout-helper.php on line 629

To Reproduce
Steps to reproduce the behavior:

  1. Install and activate the WooCommerce Stripe plugin.
  2. Go to WooCommerce > Settings > Payments and enable Stripe.
  3. Ensure the Checkout page is using the Classic Checkout block, not the [woocommerce_checkout] shortcode
  4. Attempt to edit the Checkout page in the WordPress backend. Pages > Checkout > Edit Page
  5. A critical error appears, preventing page access.

Expected behavior
The checkout page should be editable in the backend without errors.

Screenshots
The block that causes the critical error:
Image

Error while trying to edit the checkout page when the stripe payment options are active:
Image

Adding [woocommerce_checkout] in a shortcode block does not cause any issue
Image

Environment (please complete the following information):

  • WordPress Version 6.7.1
  • WooCommerce Version 9.6.1
  • Stripe Plugin Version 9.1.1
  • WooCommerce and Stripe Plugin only.

Additional context
Switching to the [woocommerce_checkout] shortcode bypasses the problem.
9349477-zen

@zain0ul0abiddin
Copy link
Author

I think I found another case here: 9375949-zen

@Mayisha
Copy link
Contributor

Mayisha commented Feb 12, 2025

This issue is fixed in #3758 and will be shipped in Stripe 9.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants