• Resolved atai66

    (@atai66)


    Hi

    If anyone can help please.

    After a call to stripe to process a card payment the screen is displaying the “There has been a critical error on this website” message. The payment is accepted, the order status is left at ‘pending’. All processing is stopped at this point. This is occurring at irregular intervals; not with every order.

    The log is showing:

    [11-Apr-2022 23:27:14 UTC] PHP Fatal error: Uncaught Error: Call to undefined method WC_Order::get_id() in /home/…./public_html/…../wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php:981

    The script class-wc-gateway-stripe.php at line 981 is

    // A webhook might have modified or locked the order while the intent was retreived. This ensures we are reading the right status.
    ***** clean_post_cache( $order->get_id() ); ******** LINE 981 ************
    $order = wc_get_order( $order->get_id() );

    There is a comment in the script which i am not sure what it means:
    * @since 4.2.0
    * @param WC_Order $order The order which is in a transitional state.

    ————————————————————————-

    WC Version: 2.6.14
    Log Directory Writable: ?
    WP Version: 5.4.2
    WP Multisite: –
    WP Memory Limit: 11 GB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_US
    
    ### Server Environment ###
    
    Server Info: Apache
    PHP Version: 7.0.33
    PHP Post Max Size: 888 MB
    PHP Time Limit: 1000
    PHP Max Input Vars: 1000
    cURL Version: 7.81.0
    OpenSSL/1.1.1n
    
    SUHOSIN Installed: –
    MySQL Version: 5.7.37
    Max Upload Size: 6 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ? Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected.
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 2.6.14
    : 
    woocommerce_sessions: ?
    woocommerce_api_keys: ?
    woocommerce_attribute_taxonomies: ?
    woocommerce_downloadable_product_permissions: ?
    woocommerce_order_items: ?
    woocommerce_order_itemmeta: ?
    woocommerce_tax_rates: ?
    woocommerce_tax_rate_locations: ?
    woocommerce_shipping_zones: ?
    woocommerce_shipping_zone_locations: ?
    woocommerce_shipping_zone_methods: ?
    woocommerce_payment_tokens: ?
    woocommerce_payment_tokenmeta: ?
    MaxMind GeoIP Database: ?
    
    ### Active Plugins (28) ###
    
    Gravity Perks: by Gravity Wiz – 1.2.18.6
    Gravity Forms: by rocketgenius – 2.3.2.2
    BlueSnap Payment Gateway for WooCommerce: by Bluesnap – 1.3.4.1
    Custom Reporting Pro: by Stuart Elliot – 0.1
    ClickToAddress Auto-Complete Integration: by Crafty Clicks – 1.1.11
    Corona Virus (COVID-19) Banner & Live Data: by Orchestrated – 1.7.0.2
    Google Tag Manager for WordPress: by Thomas Geiger – 1.14.2
    Facebook for WooCommerce: by Facebook – 2.2.0
    Gift Aid for WooCommerce: by Dave Green  – 1.3.5
    GP eCommerce Fields: by Gravity Wiz – 1.0.beta1.7
    Gravity Forms Reset Button Add-On: by Able Engine & William Wilkerson – 1.0
    GP Price Range: by David Smith – 1.0.4
    MailChimp for WooCommerce: by MailChimp – 2.1.8
    Smart Debit: by Digispace Marketing – 1.0
    Woo Donations: by Geek Web Solution – 1.4
    Advanced Order Export For WooCommerce: by AlgolPlus – 1.5.6
    Bolder Fees for WooCommerce: by Bolder Elements – 1.4.19
    WooCommerce Cart Tab: by jameskoster – 1.1.2
    WooCommerce Checkout Add-Ons: by SkyVerge – 1.11.0
    WooCommerce Checkout Field Editor: by WooCommerce – 1.5.21
    Direct Checkout for WooCommerce: by QuadLayers – 2.4.3
    WooCommerce Stripe Gateway: by WooCommerce – 4.2.4
    WooCommerce - Gravity Forms Product Add-Ons: by Lucas Stark – 3.1.10 – 3.3.26 is available
    WooCommerce Subscribe All the Things: by Prospress Inc. – 1.1.2
    WooCommerce Subscriptions: by Prospress Inc. – 2.2.4
    WooCommerce: by WooThemes – 2.6.14
    WP Downgrade | Specific Core Version: by Reisetiger – 1.2.2
    WP Rollback: by Impress.org – 1.7.1
    
    ### Settings ###
    
    Force SSL: ?
    Currency: GBP (£)
    Currency Position: left
    Thousand Separator: ,
    Decimal Separator: .
    Number of Decimals: 2
    
    ### API ###
    
    API Enabled: ?
    
    ### WC Pages ###
    
    Shop Base: ? Page ID is set
    but the page does not exist
    
    Cart: #5 - /cart/
    Checkout: #6 - /checkout/
    My Account: #7 - /my-account/
    
    ### Taxonomies ###
    
    Product Types: external (external)
    grouped (grouped)
    simple (simple)
    subscription (subscription)
    variable (variable)
    variable subscription (variable-subscription)
    
    ### Theme ###
    
    Name: Storefront
    Version: 2.3.2
    Author URL: https://woocommerce.com/
    Child Theme: ? – If you're modifying WooCommerce on a parent theme you didn't build personally
    then we recommend using a child theme. See: How to create a child theme
    
    WooCommerce Support: ?
    
    ### Templates ###
    
    Overrides: storefront 2/woocommerce/archive-product.php
    storefront 2/woocommerce/auth/footer.php
    storefront 2/woocommerce/auth/form-grant-access.php
    storefront 2/woocommerce/auth/form-login.php
    storefront 2/woocommerce/auth/header.php
    storefront 2/woocommerce/cart/cart-empty.php
    storefront 2/woocommerce/cart/cart-item-data.php
    storefront 2/woocommerce/cart/cart-shipping.php
    storefront 2/woocommerce/cart/cart-totals.php
    storefront 2/woocommerce/cart/cart.php
    storefront 2/woocommerce/cart/cross-sells.php
    storefront 2/woocommerce/cart/mini-cart.php
    storefront 2/woocommerce/cart/proceed-to-checkout-button.php
    storefront 2/woocommerce/cart/shipping-calculator.php
    storefront 2/woocommerce/checkout/cart-errors.php
    storefront 2/woocommerce/checkout/form-billing.php
    storefront 2/woocommerce/checkout/form-checkout.php
    storefront 2/woocommerce/checkout/form-coupon.php
    storefront 2/woocommerce/checkout/form-login.php
    storefront 2/woocommerce/checkout/form-pay.php
    storefront 2/woocommerce/checkout/form-shipping.php
    storefront 2/woocommerce/checkout/payment-method.php
    storefront 2/woocommerce/checkout/payment.php
    storefront 2/woocommerce/checkout/review-order.php
    storefront 2/woocommerce/checkout/terms.php
    storefront 2/woocommerce/checkout/thankyou.php
    storefront 2/woocommerce/content-product.php
    storefront 2/woocommerce/content-product_cat.php
    storefront 2/woocommerce/content-single-product.php
    storefront 2/woocommerce/content-widget-product.php
    storefront 2/woocommerce/emails/admin-cancelled-order.php
    storefront 2/woocommerce/emails/admin-failed-order.php
    storefront 2/woocommerce/emails/admin-new-order.php
    storefront 2/woocommerce/emails/customer-completed-order.php
    storefront 2/woocommerce/emails/customer-invoice.php
    storefront 2/woocommerce/emails/customer-new-account.php
    storefront 2/woocommerce/emails/customer-note.php
    storefront 2/woocommerce/emails/customer-on-hold-order.php
    storefront 2/woocommerce/emails/customer-processing-order.php
    storefront 2/woocommerce/emails/customer-refunded-order.php
    storefront 2/woocommerce/emails/customer-reset-password.php
    storefront 2/woocommerce/emails/email-addresses.php
    storefront 2/woocommerce/emails/email-customer-details.php
    storefront 2/woocommerce/emails/email-footer.php
    storefront 2/woocommerce/emails/email-header.php
    storefront 2/woocommerce/emails/email-order-details.php
    storefront 2/woocommerce/emails/email-order-items.php
    storefront 2/woocommerce/emails/email-styles.php
    storefront 2/woocommerce/emails/plain/admin-cancelled-order.php
    storefront 2/woocommerce/emails/plain/admin-failed-order.php
    storefront 2/woocommerce/emails/plain/admin-new-order.php
    storefront 2/woocommerce/emails/plain/customer-completed-order.php
    storefront 2/woocommerce/emails/plain/customer-invoice.php
    storefront 2/woocommerce/emails/plain/customer-new-account.php
    storefront 2/woocommerce/emails/plain/customer-note.php
    storefront 2/woocommerce/emails/plain/customer-on-hold-order.php
    storefront 2/woocommerce/emails/plain/customer-processing-order.php
    storefront 2/woocommerce/emails/plain/customer-refunded-order.php
    storefront 2/woocommerce/emails/plain/customer-reset-password.php
    storefront 2/woocommerce/emails/plain/email-addresses.php
    storefront 2/woocommerce/emails/plain/email-customer-details.php
    storefront 2/woocommerce/emails/plain/email-order-details.php
    storefront 2/woocommerce/emails/plain/email-order-items.php
    storefront 2/woocommerce/global/breadcrumb.php
    storefront 2/woocommerce/global/form-login.php
    storefront 2/woocommerce/global/quantity-input.php
    storefront 2/woocommerce/global/sidebar.php
    storefront 2/woocommerce/global/wrapper-end.php
    storefront 2/woocommerce/global/wrapper-start.php
    storefront 2/woocommerce/loop/add-to-cart.php
    storefront 2/woocommerce/loop/loop-end.php
    storefront 2/woocommerce/loop/loop-start.php
    storefront 2/woocommerce/loop/no-products-found.php
    storefront 2/woocommerce/loop/orderby.php
    storefront 2/woocommerce/loop/pagination.php
    storefront 2/woocommerce/loop/price.php
    storefront 2/woocommerce/loop/rating.php
    storefront 2/woocommerce/loop/result-count.php
    storefront 2/woocommerce/loop/sale-flash.php
    storefront 2/woocommerce/myaccount/dashboard.php
    storefront 2/woocommerce/myaccount/downloads.php
    storefront 2/woocommerce/myaccount/form-add-payment-method.php
    storefront 2/woocommerce/myaccount/form-edit-account.php
    storefront 2/woocommerce/myaccount/form-edit-address.php
    storefront 2/woocommerce/myaccount/form-login.php
    storefront 2/woocommerce/myaccount/form-lost-password.php
    storefront 2/woocommerce/myaccount/form-reset-password.php
    storefront 2/woocommerce/myaccount/lost-password-confirmation.php
    storefront 2/woocommerce/myaccount/my-account.php
    storefront 2/woocommerce/myaccount/my-address.php
    storefront 2/woocommerce/myaccount/my-downloads.php
    storefront 2/woocommerce/myaccount/my-orders.php
    storefront 2/woocommerce/myaccount/navigation.php
    storefront 2/woocommerce/myaccount/orders.php
    storefront 2/woocommerce/myaccount/payment-methods.php
    storefront 2/woocommerce/myaccount/view-order.php
    storefront 2/woocommerce/notices/error.php
    storefront 2/woocommerce/notices/notice.php
    storefront 2/woocommerce/notices/success.php
    storefront 2/woocommerce/order/form-tracking.php
    storefront 2/woocommerce/order/order-again.php
    storefront 2/woocommerce/order/order-details-customer.php
    storefront 2/woocommerce/order/order-details-item.php
    storefront 2/woocommerce/order/order-details.php
    storefront 2/woocommerce/order/tracking.php
    storefront 2/woocommerce/product-searchform.php
    storefront 2/woocommerce/single-product/add-to-cart/external.php
    storefront 2/woocommerce/single-product/add-to-cart/grouped.php
    storefront 2/woocommerce/single-product/add-to-cart/simple.php
    storefront 2/woocommerce/single-product/add-to-cart/variable.php
    storefront 2/woocommerce/single-product/add-to-cart/variation-add-to-cart-button.php
    storefront 2/woocommerce/single-product/add-to-cart/variation.php
    storefront 2/woocommerce/single-product/meta.php
    storefront 2/woocommerce/single-product/price.php
    storefront 2/woocommerce/single-product/product-attributes.php
    storefront 2/woocommerce/single-product/product-image.php
    storefront 2/woocommerce/single-product/product-thumbnails.php
    storefront 2/woocommerce/single-product/rating.php
    storefront 2/woocommerce/single-product/related.php
    storefront 2/woocommerce/single-product/review-meta.php
    storefront 2/woocommerce/single-product/review-rating.php
    storefront 2/woocommerce/single-product/review.php
    storefront 2/woocommerce/single-product/sale-flash.php
    storefront 2/woocommerce/single-product/share.php
    storefront 2/woocommerce/single-product/short-description.php
    storefront 2/woocommerce/single-product/tabs/additional-information.php
    storefront 2/woocommerce/single-product/tabs/description.php
    storefront 2/woocommerce/single-product/tabs/tabs.php
    storefront 2/woocommerce/single-product/title.php
    storefront 2/woocommerce/single-product/up-sells.php
    storefront 2/woocommerce/single-product-reviews.php
    storefront 2/woocommerce/single-product.php
    storefront 2/woocommerce/taxonomy-product_cat.php
    storefront 2/woocommerce/taxonomy-product_tag.php
    
    ### subscriptions ###
    
    WCS_DEBUG: ? No
    Subscriptions Mode: ? Live

    ————————————————————

    Any help much appreciated
    Thanks
    Annie

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Kaushik S. a11n

    (@kaushiksomaiya)

    Hi there!

    Thanks for contacting us!

    I understand you are seeing some errors on the checkout page for certain orders when using Stripe.

    I see that the plugin “WooCommerce Stripe Gateway” and the “WooCommerce” core plugin are outdated.

    You could try updating the plugins to the latest version and see if the error resolves.

    I’d also suggest keeping other plugins up to date. Please be sure to take a backup of your site before updating the plugins.

    I hope this helps! ??

    Thread Starter atai66

    (@atai66)

    Hi

    Thanks for your response.

    I understand the site require several plugin updates but the site is experiencing heavy traffic currently and the site owners, if possible, would like to try and fix the problem without any downtime.

    The thing that is baffling is that this error only happens to around 10% of the orders.

    Any thoughts on that?

    Thanks
    Annie

    Hi @atai66

    Thanks for the update.

    The thing that is baffling is that this error only happens to around 10% of the orders

    Please note that the basic software and the plugins being outdated could itself be the cause behind a wide variety of unusual behavior on a website. It is essential to make sure that the hosting environment setup meets the WooCommerce Server Recommendations: https://woocommerce.com/document/server-requirements/. You can read more here on why it is not a good practice to use outdated software: https://woocommerce.com/document/woocommerce-self-service-guide/#section-2

    If you experience the same behavior even after updating all the plugins, please let us know, so we can investigate deeper. At that point please also share a copy of your site’s latest System Status.

    Thanks

    Thread Starter atai66

    (@atai66)

    Hi

    Thanks for your replies.

    [11-Apr-2022 23:27:14 UTC] PHP Fatal error:  Uncaught Error: Call to undefined method WC_Order::get_id() in /home/onenatio/public_html/donate/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php:981
    Stack trace:
    #0 /home/onenatio/public_html/donate/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-stripe-intent-controller.php(102): WC_Gateway_Stripe->verify_intent_after_checkout(Object(WC_Order))
    #1 /home/onenatio/public_html/donate/wp-includes/class-wp-hook.php(287): WC_Stripe_Intent_Controller->verify_intent('')
    #2 /home/onenatio/public_html/donate/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters('', Array)
    #3 /home/onenatio/public_html/donate/wp-includes/plugin.php(478): WP_Hook->do_action(Array)
    #4 /home/onenatio/public_html/donate/wp-content/plugins/woocommerce/includes/class-wc-ajax.php(82): do_action('wc_ajax_wc_stri...')
    #5 /home/onenatio/public_html/donate/wp-includes/class-wp-hook.php(287): WC_AJAX::do_wc_ajax('')
    #6 /home/onenatio/public_html/donate/wp-includes/class-wp-hook.php(311): WP_H in /home/onenatio/public_html/donate/wp-content/plugins/woocommerce-gateway-stripe/includes/class-wc-gateway-stripe.php on line 981

    clean_post_cache( $order->get_id() ); (line 981)

    Generally, what does “Call to undefined method WC_Order::get_id()” mean?

    Thanks

    Regards
    Annie

    Mirko P.

    (@rainfallnixfig)

    Hi there,

    Thanks for getting back to us.

    You may want to ask your question to a developer in the Slack Community. I’m sure they can provide more technical details to you.

    This forum is more basic and doesn’t support development topics. In general, when these errors appear it’s due to incompatibility between themes and plugins. Developers release new versions of their products so to solve incompatibility issues that generate this type of error.

    Since it’s not possible to do updates on your live site we recommend quickly spinning up a live replica, a staging site, where you could check the issue further without affecting the production site. Some hosts offer staging sites, but if you don’t have such a feature, you can create one with the WP Staging plugin.

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fatal Error undefined method WC_Order::get_id()’ is closed to new replies.