• Resolved Mayank

    (@_mayank_)


    Hello,

    I am facing a FATAL Error while fetching Orders via REST API. I am attaching a Live link that will lead you to the above error.
    Kindly Suggest how to resolve it.

    [ redundant link removed ]

    ERROR

    <b style="color: rgb(68, 68, 68); font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: medium; white-space-collapse: collapse;">Fatal error</b><span style="color: rgb(68, 68, 68); font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: medium; white-space-collapse: collapse; background-color: rgb(255, 255, 255);">: Uncaught Error: Call to a member function get_id() on bool in /home/u937874938/domains/bigbagtheory.in/public_html/wp-content/plugins/woocommerce/includes/legacy/api/v3/class-wc-api-orders.php:161 Stack trace: #0 /home/u937874938/domains/bigbagtheory.in/public_html/wp-content/plugins/woocommerce/includes/legacy/api/v3/class-wc-api-orders.php(124): WC_API_Orders->get_order(4590, NULL, Array) #1 /home/u937874938/domains/bigbagtheory.in/public_html/wp-content/plugins/woocommerce/includes/legacy/api/v3/class-wc-api-server.php(371): WC_API_Orders->get_orders(NULL, Array, NULL, 1) #2 /home/u937874938/domains/bigbagtheory.in/public_html/wp-content/plugins/woocommerce/includes/legacy/api/v3/class-wc-api-server.php(222): WC_API_Server->dispatch() #3 /home/u937874938/domains/bigbagtheory.in/public_html/wp-content/plugins/woocommerce/includes/legacy/class-wc-legacy-api.php(175): WC_API_Server->serve_request() #4 /home/u937874938/domains/bigbagtheory.in/public_html/wp-includes/class-wp-hook.php(324): WC_Legacy_API->handl in </span><b style="color: rgb(68, 68, 68); font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: medium; white-space-collapse: collapse;">/home/u937874938/domains/bigbagtheory.in/public_html/wp-content/plugins/woocommerce/includes/legacy/api/v3/class-wc-api-orders.php</b><span style="color: rgb(68, 68, 68); font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: medium; white-space-collapse: collapse; background-color: rgb(255, 255, 255);"> on line </span><b style="color: rgb(68, 68, 68); font-family: -apple-system, "system-ui", "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; font-size: medium; white-space-collapse: collapse;">161</b>

    SYSTEM REPORT

    ` WordPress Environment
    
    WordPress address (URL): https://www.bigbagtheory.in<br>Site address (URL): https://www.bigbagtheory.in<br>WC Version: 8.5.2<br>REST API Version: ✔ 8.5.2<br>WC Blocks Version: ✔ 11.8.0-dev<br>Action Scheduler Version: ✔ 3.7.1<br>Log Directory Writable: ✔<br>WP Version: 6.4.3<br>WP Multisite: –<br>WP Memory Limit: 2 GB<br>WP Debug Mode: ✔<br>WP Cron: ✔<br>Language: en_US<br>External object cache: – Server Environment
    
    Server Info: LiteSpeed<br>PHP Version: 7.4.33<br>PHP Post Max Size: 2 GB<br>PHP Time Limit: 360<br>PHP Max Input Vars: 5000<br>cURL Version: 7.87.0<br>OpenSSL/1.1.1p
    
    SUHOSIN Installed: –<br>MySQL Version: 5.5.5-10.5.19-MariaDB-cll-lve<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
    
    WC Database Version: 8.5.2<br>WC Database Prefix: wp_<br>Total Database Size: 35.23MB<br>Database Data Size: 28.22MB<br>Database Index Size: 7.01MB<br>wp_woocommerce_sessions: Data: 0.31MB + Index: 0.02MB + Engine InnoDB<br>wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB<br>wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB<br>wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_actionscheduler_actions: Data: 1.52MB + Index: 0.75MB + Engine InnoDB<br>wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_actionscheduler_logs: Data: 1.52MB + Index: 0.36MB + Engine InnoDB<br>wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_comments: Data: 0.05MB + Index: 0.09MB + Engine InnoDB<br>wp_e_events: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_litespeed_avatar: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_litespeed_img_optming: Data: 0.02MB + Index: 0.05MB + Engine InnoDB<br>wp_litespeed_url: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_litespeed_url_file: Data: 0.09MB + Index: 0.27MB + Engine InnoDB<br>wp_options: Data: 3.47MB + Index: 0.27MB + Engine InnoDB<br>wp_postmeta: Data: 10.52MB + Index: 3.03MB + Engine InnoDB<br>wp_posts: Data: 7.52MB + Index: 0.30MB + Engine InnoDB<br>wp_rank_math_404_logs: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_rank_math_analytics_keyword_manager: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>wp_rank_math_analytics_objects: Data: 0.05MB + Index: 0.02MB + Engine InnoDB<br>wp_rank_math_internal_links: Data: 0.20MB + Index: 0.08MB + Engine InnoDB<br>wp_rank_math_internal_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>wp_revslider_css: Data: 0.13MB + Index: 0.02MB + Engine InnoDB<br>wp_revslider_css_bkp: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_revslider_layer_animations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>wp_revslider_layer_animations_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>wp_revslider_navigations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>wp_revslider_navigations_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>wp_revslider_sliders: Data: 0.09MB + Index: 0.02MB + Engine InnoDB<br>wp_revslider_sliders_bkp: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_revslider_slides: Data: 0.20MB + Index: 0.02MB + Engine InnoDB<br>wp_revslider_slides_bkp: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_revslider_static_slides: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_revslider_static_slides_bkp: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_termmeta: Data: 0.06MB + Index: 0.06MB + Engine InnoDB<br>wp_terms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_term_relationships: Data: 0.08MB + Index: 0.05MB + Engine InnoDB<br>wp_term_taxonomy: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_usermeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB<br>wp_wcpdf_invoice_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>wp_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB<br>wp_wc_admin_note_actions: Data: 1.03MB + Index: 0.02MB + Engine InnoDB<br>wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_wc_orders: Data: 0.02MB + Index: 0.11MB + Engine InnoDB<br>wp_wc_orders_meta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB<br>wp_wc_order_addresses: Data: 0.02MB + Index: 0.06MB + Engine InnoDB<br>wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_wc_order_operational_data: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB<br>wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB<br>wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB<br>wp_wc_product_attributes_lookup: Data: 0.06MB + Index: 0.05MB + Engine InnoDB<br>wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_wc_product_meta_lookup: Data: 0.11MB + Index: 0.16MB + Engine InnoDB<br>wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB<br>wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_yith_wcwl: Data: 0.02MB + Index: 0.02MB + Engine InnoDB<br>wp_yith_wcwl_lists: Data: 0.02MB + Index: 0.03MB + Engine InnoDB Post Type Counts
    
    attachment: 853<br>custom_css: 3<br>customize_changeset: 1<br>elementor_library: 3<br>mc4wp-form: 1<br>nav_menu_item: 161<br>page: 18<br>post: 3<br>product: 131<br>product_variation: 597<br>revision: 170<br>shop_coupon: 1<br>shop_order: 8<br>shop_order_placehold: 7<br>ts_footer_block: 1<br>ts_logo: 7<br>ts_mega_menu: 6<br>ts_size_chart: 1<br>ts_team: 4<br>ts_testimonial: 5<br>wp_global_styles: 4<br>wp_navigation: 1<br>wp_template: 2<br>wpcf7_contact_form: 1 Security
    
    Secure connection (HTTPS): ✔<br>Hide errors from visitors: ❌Error messages should not be shown to visitors. Active Plugins (20)
    
    Redux Framework: by Team Redux – 4.4.13<br>Contact Form 7: by Takayuki Miyoshi – 5.8.7<br>Joinchat: by Creame – 5.0.17<br>Duplicate Page: by mndpsingh287 – 4.5.3<br>Elementor: by Elementor.com – 3.19.2<br>Extendify: by Extendify – 1.12.2<br>Site Kit by Google: by Google – 1.120.0<br>LiteSpeed Cache: by LiteSpeed Technologies – 6.1<br>MC4WP: Mailchimp for WordPress: by ibericode – 4.9.11<br>One Click Demo Import: by OCDI – 3.2.0<br>PhonePe Payment Solutions: by PhonePe – 2.0.11<br>Slider Revolution: by ThemePunch – 6.6.19<br>Rank Math SEO PRO: by Rank Math – 3.0.49<br>Rank Math SEO: by Rank Math – 1.0.212.1<br>ThemeSky: by ThemeSky Team – 1.0.4<br>PDF Invoices & Packing Slips for WooCommerce: by WP Overnight – 3.7.7<br>WooCommerce: by Automattic – 8.5.2<br>WP Rollback: by WP Rollback – 2.0.6<br>YITH WooCommerce Compare: by YITH – 2.35.0<br>YITH WooCommerce Wishlist: by YITH – 3.29.0 Inactive Plugins (1)
    
    Shipment Tracker for Woocommerce: by Bitss Techniques – 1.3.13 Settings
    
    API Enabled: ✔<br>Force SSL: –<br>Currency: INR (₹)<br>Currency Position: left<br>Thousand Separator: ,<br>Decimal Separator: .<br>Number of Decimals: 2<br>Taxonomies: Product Types: external (external)<br>grouped (grouped)<br>simple (simple)<br>variable (variable)
    
    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)
    
    Connected to Woo.com: –<br>Enforce Approved Product Download Directories: ✔<br>HPOS feature screen enabled: ✔<br>HPOS feature enabled: ✔<br>Order datastore: Automattic\WooCommerce\Internal\DataStores\Orders\OrdersTableDataStore<br>HPOS data sync enabled: – WC Pages
    
    Shop base: #6 - /shop/<br>Cart: #5789 - /cart/<br>Checkout: #5790 - /checkout/<br>My account: #5791 - /my-account/<br>Terms and conditions: ❌ Page not set Theme
    
    Name: Jaroti Child<br>Version: 1.0.0<br>Author URL: http://theme-sky.com/<br>Child Theme: ✔<br>Parent Theme Name: Jaroti<br>Parent Theme Version: 1.1.3<br>Parent Theme Author URL: https://theme-sky.com/<br>WooCommerce Support: ✔ Templates
    
    Overrides: jaroti/woocommerce/archive-product.php<br>jaroti/woocommerce/content-product-cat.php<br>jaroti/woocommerce/content-product.php<br>jaroti/woocommerce/content-widget-product.php<br>jaroti/woocommerce/loop/add-to-cart.php<br>jaroti/woocommerce/loop/loop-end.php<br>jaroti/woocommerce/loop/loop-start.php<br>jaroti/woocommerce/loop/orderby.php<br>jaroti/woocommerce/single-product/rating.php<br>jaroti/woocommerce/single-product/tabs/description.php<br>jaroti/woocommerce/single-product-reviews.php<br>jaroti/woocommerce/single-product.php Admin
    
    Enabled Features: activity-panels<br>analytics<br>product-block-editor<br>coupons<br>core-profiler<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>product-variation-management<br>product-virtual-downloadable<br>product-external-affiliate<br>product-grouped<br>remote-inbox-notifications<br>remote-free-extensions<br>payment-gateway-suggestions<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
    
    Disabled Features: customize-store<br>minified-js<br>new-product-management-experience<br>product-linked<br>settings<br>async-product-editor-category-field
    
    Daily Cron: ✔ Next scheduled: 2024-02-16 09:11:40 +05:30<br>Options: ✔<br>Notes: 73<br>Onboarding: skipped Action Scheduler
    
    Canceled: 1<br>Oldest: 2024-02-05 12:43:57 +0530<br>Newest: 2024-02-05 12:43:57 +0530
    
    Complete: 2,549<br>Oldest: 2024-01-16 07:51:21 +0530<br>Newest: 2024-02-15 14:58:18 +0530
    
    Failed: 2<br>Oldest: 2024-01-11 14:10:39 +0530<br>Newest: 2024-01-27 21:07:40 +0530
    
    Pending: 4<br>Oldest: 2024-02-15 23:25:49 +0530<br>Newest: 2025-01-01 00:00:01 +0530 Status report information
    
    Generated at: 2024-02-15 16:56:15 +05:30<br>`
    • This topic was modified 1 year, 10 months ago by Mayank.

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Zee

    (@doublezed2)

    Hello Mayank,

    Thank you for reaching out and contacting WooCommerce support.

    I understand you’re experiencing a fatal error when attempting to fetch orders using the REST API, specifically an “Uncaught Error: Call to a member function get_id() on bool.”.

    To assist you further, I’d like to understand more about your setup. Could you please send me a copy of your site’s System Status Report?
    This will give me a better overview of your environment and any possible conflicts or issues that might be occurring.

    Here are the steps to follow:
    1. Navigate to WooCommerce > Status in your WordPress dashboard.
    2. Click on ‘Get system report.’
    3. Then click on ‘Copy for support.’

    Once you have the report, you can paste the text at https://gist.github.com. After saving your Gist, please paste the Gist link here in your reply.

    This information will be crucial for diagnosing the issue further.
    Looking forward to your response. 🙂

    Best regards.

    Thread Starter Mayank

    (@_mayank_)

    Plugin Support Shameem – a11n

    (@shameemreza)

    Hey Mayank,

    From the error message you’ve shared, it looks like there’s an issue with the get_id() function being called on a boolean value in your WC_API_Orders class. This error usually occurs when the order ID that the get_order function is trying to fetch does not exist or is not valid.

    Here are a few steps you can take further to troubleshoot this issue:

    1. Verify that the Order ID 4590 exists in your WooCommerce store and is valid.
    2. If the Order ID is valid, check your REST API call to make sure you’re passing the correct parameters.
    3. If the problem persists, try disabling all other plugins except WooCommerce to check if there’s a conflict with another plugin.

    If you are still having problems, we recommend asking development questions on the #developers channel of the WooCommerce Community Slack. Many of our developers hang out there and will be able to offer insights into your question.

    I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.

    Thread Starter Mayank

    (@_mayank_)

    Hi All,

    Thanks for checking the issue, but I have figured this out why this error was generating and resolved it 🙂

    Plugin Support Shameem – a11n

    (@shameemreza)

    Hey Mayank,

    I’m glad you were able to find a solution to your inquiry here. We’d love it if you could share your solution with the community. This way, anyone who encounters this issue in the future can resolve it using your solution.

    Meanwhile, should you have further inquiries, kindly create a new topic here.

    Thanks!

    I’ve got the same problem @_mayank_, so if you can share your solution, please do so!

    • This reply was modified 1 year, 9 months ago by rubendaas.
    Thread Starter Mayank

    (@_mayank_)

    Hi @rubendaas, below trick worked for me.

    Go to Woocommerce > Settings > Advance > Features > Disable High-performance order storage.

    Also, Enable compatibility mode (synchronizes orders to the posts table).

    @_mayank_ Thank you so much, we’d been looking for that function for days now haha.

    Thread Starter Mayank

    (@_mayank_)

    I hope it worked for you as well. @rubendaas

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

The topic ‘Order are not fetching from REST API in JSON’ is closed to new replies.