• Resolved jafarsadiqu

    (@jafarsadiqu)


    When processing a refund, the site generates a fatal error, and the order edit page gets broken. https://screenrec.com/share/Lhr2ICtAHm https://prnt.sc/mrBgXxA1DPA0

    on error log we have this error

    2025-05-08T20:48:15+00:00 Critical Uncaught Error: Call to a member function get_items() on int in /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php:2220  
    Additional context
    {
    "error": {
    "type": 1,
    "file": "/home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php",
    "line": 2220
    },
    "remote-logging": true,
    "backtrace": [
    "",
    "#0 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/plugins/woocommerce/templates/myaccount/orders.php(39): WC_Order->get_item_count_refunded()",
    "#1 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(346): include('/home/1235416.c...')",
    "#2 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php(3544): wc_get_template()",
    "#3 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/class-wp-hook.php(324): woocommerce_account_orders()",
    "#4 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()",
    "#5 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()",
    "#6 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/plugins/woocommerce/includes/wc-template-functions.php(3492): do_action()",
    "#7 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/class-wp-hook.php(324): woocommerce_account_content()",
    "#8 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()",
    "#9 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()",
    "#10 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/plugins/woocommerce/templates/myaccount/my-account.php(34): do_action()",
    "#11 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/plugins/woocommerce/includes/wc-core-functions.php(346): include('/home/1235416.c...')",
    "#12 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-my-account.php(125): wc_get_template()",
    "#13 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/plugins/woocommerce/includes/shortcodes/class-wc-shortcode-my-account.php(57): WC_Shortcode_My_Account::my_account()",
    "#14 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/plugins/woocommerce/includes/class-wc-shortcodes.php(75): WC_Shortcode_My_Account::output()",
    "#15 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/plugins/woocommerce/includes/class-wc-shortcodes.php(118): WC_Shortcodes::shortcode_wrapper()",
    "#16 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/shortcodes.php(434): WC_Shortcodes::my_account()",
    "#17 [internal function]: do_shortcode_tag()",
    "#18 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/shortcodes.php(273): preg_replace_callback()",
    "#19 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/class-wp-hook.php(324): do_shortcode()",
    "#20 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/plugin.php(205): WP_Hook->apply_filters()",
    "#21 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/post-template.php(256): apply_filters()",
    "#22 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/themes/storefront/inc/storefront-template-functions.php(352): the_content()",
    "#23 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/class-wp-hook.php(324): storefront_page_content()",
    "#24 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters()",
    "#25 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/plugin.php(517): WP_Hook->do_action()",
    "#26 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/themes/storefront/content-page.php(18): do_action()",
    "#27 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/template.php(812): require('/home/1235416.c...')",
    "#28 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/template.php(745): load_template()",
    "#29 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/general-template.php(206): locate_template()",
    "#30 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-content/themes/storefront/page.php(24): get_template_part()",
    "#31 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-includes/template-loader.php(106): include('/home/1235416.c...')",
    "#32 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/wp-blog-header.php(19): require_once('/home/1235416.c...')",
    "#33 /home/1235416.cloudwaysapps.com/aakagqrwwg/public_html/index.php(17): require('/home/1235416.c...')",
    "#34 {main}",
    "thrown"
    ]
    }

    The page I need help with: https://www.durkintactical.com/

    regarding this error i created a support ticket on authorize.net then they also said that this error is from WooCommerce Shipping & Tax plugin. refer:https://ww.wp.xz.cn/support/topic/critical-error-on-refund/#new-topic-0

    so please check this. i can see this error happening daily from last one week.

    please CC [email protected]

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter jafarsadiqu

    (@jafarsadiqu)

    2025-05-01T18:38:36+00:00 Critical Uncaught Error: Call to a member function get_items() on int in /home/1235416.cloudwaysapps.com/kkxqkbqszd/public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php:2220  

    Additional context

    {

    "error": {

    "type": 1,

    "file": "/home/1235416.cloudwaysapps.com/kkxqkbqszd/public_html/wp-content/plugins/woocommerce/includes/class-wc-order.php",

    "line": 2220

    },

    "remote-logging": true,

    "backtrace": [

    "",

    "#0 /home/1235416.cloudwaysapps.com/kkxqkbqszd/public_html/wp-content/plugins/woocommerce-services/classes/class-wc-connect-shipping-label.php(592): WC_Order->get_item_count_refunded()",

    "#1 /home/1235416.cloudwaysapps.com/kkxqkbqszd/public_html/wp-admin/includes/template.php(1456): WC_Connect_Shipping_Label->meta_box()",

    "#2 /home/1235416.cloudwaysapps.com/kkxqkbqszd/public_html/wp-admin/edit-form-advanced.php(715): do_meta_boxes()",

    "#3 /home/1235416.cloudwaysapps.com/kkxqkbqszd/public_html/wp-admin/post.php(206): require('/home/1235416.c...')",

    "#4 {main}",

    "thrown"

    ]

    }

    Hi @jafarsadiqu,

    Thank you for sharing the detailed error logs, and URLs regarding the fatal error you’re encountering during refunds on https://www.durkintactical.com/. I understand how important a smooth refund and order management process is for your store.

    The error Call to a member function get_items() on int in class-wc-order.php suggests that an order ID (an integer) is being used where a WC_Order object is expected.

    This typically happens when a plugin, custom code, or snippet passes an order ID directly to the shipping label handler without first converting it to a WC_Order object.

    To move forward, could you please share your system status report from WooCommerce > Status > Get system report > Copy for support, and paste the contents to Pastebin or a similar service?

    Once I have that, I’ll be able to better assess your setup and guide you with troubleshooting.

    Thread Starter jafarsadiqu

    (@jafarsadiqu)

    Zee

    (@doublezed2)

    Hello jafarsadiqu,

    Thank you for sharing your site’s System Status Report.

    I noticed that there are 76 active plugins, which is quite a high number. Having so many plugins active at once can sometimes lead to conflicts and unexpected behavior.

    To help isolate the issue, I recommend temporarily deactivating all plugins except WooCommerce and WooCommerce Shipping & Tax, then testing the functionality again to see if the problem persists.

    This will help determine if another plugin is causing the issue. Please let me know how it goes, and I’ll be happy to assist you further.

    Best regards.

    Thread Starter jafarsadiqu

    (@jafarsadiqu)

    hi @doublezed2

    We’ve noticed that this issue occurs during the refund process, although not with every refund. While we can’t deactivate other plugins or perform tests on our live site, we do have a staging environment available. However, we’re unable to share credentials publicly on this platform.

    If you have a secure method for sharing credentials, please let us know. Alternatively, you can share your email address so we can send the staging access details privately.

    I also reviewed the specific line of code mentioned in the error, and it appears to be related to fetching refund data, which seems to be where the issue is triggered. We’d appreciate your prompt assistance in resolving this.

    Thanks

    Jafar

    Plugin Support shahzeen(woo-hc)

    (@shahzeenfarooq)

    Hi there,

    Thank you for the update and for taking the time to review the error details.

    As per the guidelines of the ww.wp.xz.cn support forums, we’re unable to accept login credentials or provide support via email or other private channels. All support must be conducted publicly through the forum.

    Since you have a staging environment available, I recommend replicating the issue there with only WooCommerce and your payment gateway active. This will help determine whether a plugin conflict or custom code might be causing the issue during the refund process.

    For more details on how to run a conflict test you can use the following guide: https://woo.com/document/how-to-test-for-conflicts/

    Let us know if you still face the same issue

    Plugin Support Feten L. a11n

    (@fetenlakhal)

    Hi there,

    It’s been a little while since we last heard from you, so I’ll mark this as resolved. Reach out anytime if you’d like to revisit this!

    Apart from this, if you’re happy with our plugin and the support you’ve received, we’d really appreciate a review: https://ww.wp.xz.cn/support/plugin/woocommerce-services/reviews/#new-post

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Critical error on refund’ is closed to new replies.