• Resolved nuraz1

    (@nuraz1)


    Hello, does anyone know what’s causing this error? When I got to Analytics >> Orders I get a “There was an error getting your stats. Please try again.” It seems to only cause problems with the “Pending Payment Status” orders.

    [16-Jul-2023 22:49:01 UTC] PHP Fatal error:  Uncaught Error: Call to a member function get_id() on bool in /home/public_html/wp-content/plugins/woocommerce/src/Admin/API/Reports/Controller.php:169
    
    Stack trace:
    
    #0 /home/public_html/wp-content/plugins/woocommerce/src/Admin/API/Reports/Orders/Controller.php(81): Automattic\WooCommerce\Admin\API\Reports\Controller->get_order_number(27303)
    
    #1 /home/public_html/wp-includes/rest-api/class-wp-rest-server.php(1181): Automattic\WooCommerce\Admin\API\Reports\Orders\Controller->get_items(Object(WP_REST_Request))
    
    #2 /home/public_html/wp-includes/rest-api/class-wp-rest-server.php(1028): WP_REST_Server->respond_to_request(Object(WP_REST_Request), '/wc-analytics/r...', Array, NULL)
    
    #3 /home/public_html/wp-includes/rest-api/class-wp-rest-server.php(442): WP_REST_Server->dispatch(Object(WP_REST_Request))
    
    #4 /home/public_html/wp-includes/rest-api.php(410): WP_REST_Server->serve_request('/wc-analytics/r...')
    
    #5 /home/public_html/wp-includes/class-wp-hook.php(308): rest_api_loaded(Object(WP))
    
    #6 /home/public_html/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)
    
    #7 /home/public_html/wp-includes/plugin.php(565): WP_Hook->do_action(Array)
    
    #8 /home/public_html/wp-includes/class-wp.php(399): do_action_ref_array('parse_request', Array)
    
    #9 /home/public_html/wp-includes/class-wp.php(780): WP->parse_request('')
    
    #10 /home/public_html/wp-includes/functions.php(1334): WP->main('')
    
    #11 /home/public_html/wp-blog-header.php(16): wp()
    
    #12 /home/public_html/index.php(17): require('/home/...')
    
    #13 {main}
    
      thrown in /home/public_html/wp-content/plugins/woocommerce/src/Admin/API/Reports/Controller.php on line 169
Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @nuraz1 ,

    Thanks for reaching out!

    I understand that you are seeing There was an error getting your stats. Please try again when navigating to Analytics → Orders, is this correct?

    It seems to only cause problems with the “Pending Payment Status” orders

    Please can you provide more clarity on this? Do you mean that the error only occurs when filtering the orders? A screenshot of what you are seeing may be helpful.

    If you do not already have a screenshot tool installed, Snipboard.io can be used for easily sharing screenshots. Please follow the instructions on that page, then paste the URL in this thread.

    Based on the error message you provided, it appears that there might be an issue with the get_id() function call in the Reports/Controller.php file at line 169. The error message suggests that the function is being called on a boolean value, which is likely causing the issue.

    Please clarify if this is a new issue, or one that has been ongoing for a while? If the former, do you recall any changes/updates made to the site prior to noticing this issue?

    Additionally, can you please share a copy of your sites System Status Report so that we can have a better understanding of your sites current environment.

    You can find this via WooCommerce → Status. Select Get system report and then Copy for support. Once you have this, please share the results with us here.

    Cheers!

    Thread Starter nuraz1

    (@nuraz1)

    Yes, I’ve discovered that when I turn refunded orders to none while showing only pending it will allow me to view the orders. It’s weird, it’s been like this for a long time, ever since we started using woocommerce.

    https://snipboard.io/Dqjhba.jpg

    WooCommerce Report: https://citizen.b-cdn.net/woocommerce-report.txt

    Hi @nuraz1 ,

    Thanks for sharing the above!

    This is not something I am able to replicate on my test site, as all order types are displayed without any error being triggered.

    I’d suggest performing a full conflict test to rule out any theme/plugin conflicts that may be causing the error.

    You can do this by following the steps outlined in the support guide here:

    Let us know how this goes!

    I have a similar issue with one of my sites. The error message only appears when the date interval “This month” is selected. If I select any other intervals, it shows the statistics.

    Hi @johnnybravo69,

    I have a similar issue with one of my sites. The error message only appears when the date interval “This month” is selected. If I select any other intervals, it shows the statistics.

    From what I understand, you’re experiencing a similar issue to @nuraz1 where you’re seeing an error message when you select “This month” under date intervals in your WooCommerce Analytics. However, other intervals display the statistics correctly.

    Given that each site setup is unique, and to ensure we adhere to our 👉 forum’s best practices, could you kindly initiate a 👉 new topic in our support forum? This approach helps us zero in on your specific issue and allows other users facing a similar problem to easily find and benefit from the discussion.

    In your new topic, could you please provide as much detail as possible? This might include screenshots, error messages, the steps you’ve already taken to try to resolve the issue, and any other information you think might be relevant.

    You can use https://snipboard.io to share screenshots. Just follow the instructions on the page and paste the URL in your reply.

    Thank you for your understanding and cooperation. We look forward to assisting you further on the new topic.

    Hi @bisratlearn,

    Yes you are correct regarding the intervals. I can also add that connecting with the WooCommerce for iPhone to the same site doesn’t have any issues at all.

    But I will start a new topic, sorry for adding to this topic with my problems here 😞

    Hi @johnnybravo69,

    Yes you are correct regarding the intervals. I can also add that connecting with the WooCommerce for iPhone to the same site doesn’t have any issues at all.

    But I will start a new topic, sorry for adding to this topic with my problems here 😞

    No need to apologize at all, we’re here to help! I’m glad to hear that you’re not experiencing any issues when connecting with the WooCommerce for iPhone.

    Starting a new topic will definitely help us to focus on your specific issue and provide a more tailored solution. Please don’t hesitate to include all the relevant details, as this will assist us in diagnosing and resolving your issue more efficiently.

    Thank you for your cooperation. We look forward to helping you resolve this issue on the new topic.

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

The topic ‘WooCommerce Analytics Error’ is closed to new replies.