woocommerce / wc-api-php

WooCommerce REST API PHP Library
https://packagist.org/packages/automattic/woocommerce
MIT License
528 stars 160 forks source link

Cannot access product information from woocomerce website using rest api v2 #132

Closed vandan-noesis closed 7 years ago

vandan-noesis commented 7 years ago

Below is the sample of the error

price was called incorrectly . Product properties should not be accessed directly. Backtrace: require('wp-blog-header.php'), wp, WP->main, WP->parse_request, do_action_ref_array, WP_Hook->do_action, WP_Hook->apply_filters, call_user_func_array, rest_api_loaded, WP_REST_Server->serve_request, WP_REST_Server->dispatch, call_user_func, WC_REST_CRUD_Controller->get_items, WC_REST_Products_Controller->prepare_object_for_response, WC_REST_Products_Controller->get_product_data, WC_Product->get_price_html, apply_filters('woocommerce_get_price_html'), WP_Hook->apply_filters, call_user_func_array, road_woo_price_html, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong Please see Debugging in WordPress for more information. (This message was added in version 3.0.) in on line

This kind of error normally comes when woocommerce got updated to 3.0 where we cannot access product or object properties in array format but in object format . Till date woocommerce client was working fine suddenly this error started are coming.

I am using 1.2 woocommerce php client .

Please let me know where i am wrong.

claudiosanches commented 7 years ago

If you updated WooCommerce and stared to have this problem you should fix on your WooCommerce installation, so is not an issue with this REST API wrapper.