This update has broken the report sale API.
-
I tried using this API:?
wcapi.get("reports/sales?period=month").json()
. It worked fine before the upgrade, but after upgrading to version 1.5.7, the values returned are all 0.
I have inquired with WooCommerce plugin support and confirmed that the issue is caused by the upgrade of the Woo-wallet plugin.
The detailed tracking URL is: https://www.ads-software.com/support/topic/is-there-an-issue-with-the-retrieve-sales-report-api/#post-17990908Result:
[{‘total_sales’: ‘0.00’, ‘net_sales’: ‘0.00’, ‘average_sales’: ‘0.00’, ‘total_orders’: 0, ‘total_items’: 0, ‘total_tax’: ‘0.00’, ‘total_shipping’: ‘0.00’, ‘total_refunds’: 0, ‘total_discount’: ‘0.00’, ‘totals_grouped_by’: ‘day’, ‘totals’: {‘2024-09-01’: {‘sales’: ‘0.00’, ‘orders’: 0, ‘items’: 0, ‘tax’: ‘0.00’, ‘shipping’: ‘0.00’, ‘discount’: ‘0.00’, ‘customers’: 2}, ‘2024-09-02’: {‘sales’: ‘0.00’, ‘orders’: 0, ‘items’: 0, ‘tax’: ‘0.00’, ‘shipping’: ‘0.00’, ‘discount’: ‘0.00’, ‘customers’: 6}, ‘2024-09-03’: {‘sales’: ‘0.00’, ‘orders’: 0, ‘items’: 0, ‘tax’: ‘0.00’, ‘shipping’: ‘0.00’, ‘discount’: ‘0.00’, ‘customers’: 0}}, ‘total_customers’: 8, ‘_links’: {‘about’: [{‘href’: ‘https://$mydomain/wp-json/wc/v3/reports’}]}}]error log
[error] 294169#0: *1827 FastCGI sent in stderr: "PHP message: WC_Order_Data_Store_CPT::query was called incorrectly. 目前的訂單資料存放區不支援訂單查詢引數 (meta_query)。 Backtrace: require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WC_REST_Report_Sales_V1_Controller->get_items, WC_REST_Report_Sales_V1_Controller->prepare_item_for_response, WC_Report_Sales_By_Date->get_report_data, WC_Report_Sales_By_Date->query_report_data, WC_Admin_Report->get_order_report_data, apply_filters('woocommerce_reports_get_order_report_query'), WP_Hook->apply_filters, WooWallet->woocommerce_reports_get_order_report_query, get_wallet_rechargeable_orders, wc_get_orders, WC_Order_Query->get_orders, WC_Data_Store->__call, WC_Order_Data_Store_CPT->query, wc_doing_it_wrong. This message was added in version 9.2.0.PHP message: WC_Order_Data_Store_CPT::query was called incorrectly. 目前的訂單資料存放區不支援訂單查詢引數 (meta_query)。 Backtrace: require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WC_REST_Report_Sales_V1_Controller->get_items, WC_REST_Report_Sales_V1_Controller->prepare_item_for_response, WC_Report_Sales_By_Date->get_report_data, WC_Report_Sales_By_Date->query_report_data, WC_Admin_Report->get_order_report_data, apply_filters('woocommerce_reports_get_order_report_query'), WP_Hook->apply_filters, WooWallet->woocommerce_reports_get_order_report_query, get_wallet_rechargeable_orders, wc_get_orders, WC_Order_Query->get_orders, WC_Data_Store->__call, WC_Order_Data_Store_CPT->query, wc_doing_it_wrong. This message was added in version 9.2.0.PHP message: WC_Order_Data_Sto
[error] 294169#0: *1827 FastCGI sent in stderr: "pond_to_request, WC_REST_Report_Sales_V1_Controller->get_items, WC_REST_Report_Sales_V1_Controller->prepare_item_for_response, WC_Report_Sales_By_Date->get_report_data, WC_Report_Sales_By_Date->query_report_data, WC_Admin_Report->get_order_report_data, apply_filters('woocommerce_reports_get_order_report_query'), WP_Hook->apply_filters, WooWallet->woocommerce_reports_get_order_report_query, get_wallet_rechargeable_orders, wc_get_orders, WC_Order_Query->get_orders, WC_Data_Store->__call, WC_Order_Data_Store_CPT->query, wc_doing_it_wrong. This message was added in version 9.2.0.PHP message: WC_Order_Data_Store_CPT::query was called incorrectly. 目前的訂單資料存放區不支援訂單查詢引數 (meta_query)。 Backtrace: require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WC_REST_Report_Sales_V1_Controller->get_items, WC_REST_Report_Sales_V1_Controller->prepare_item_for_response, WC_Report_Sales_By_Date->get_report_data, WC_Report_Sales_By_Date->query_report_data, WC_Admin_Report->get_order_report_data, apply_filters('woocommerce_reports_get_order_report_query'), WP_Hook->apply_filters, WooWallet->woocommerce_reports_get_order_report_query, get_wallet_rechargeable_orders, wc_get_orders, WC_Order_Query->get_orders, WC_Data_Store->__call, WC_Order_Data_Store_CPT->query, wc_doing_it_wrong. This message was added in version 9.2.0.PHP message: WC_Order_Data_Store_CPT::query was called incorrectly. 目前的訂單資料存放區不支援訂單查詢引數 (meta_query)。 Backtrace: require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array('parse_request'), WP_Hook->do_action, WP_Hook->apply_filters, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, WP_REST_Server->respond_to_request, WC_REST_Repor..
- You must be logged in to reply to this topic.