For specific product needs, I am creating a custom api for my application to query WooCommerce.
I am able to hook into the ‘parse_request’ action, but it would seem that this is too early for woocommerce to be correctly setup.
I know this because if I try to query for order information, I am getting back error objects saying that taxonomie is incorrect.
What do I need to do to correctly have woocommerce initialised so that I can query for orders and products (along with their custom attributes) ?
Can anyone help me with this ?
I’m not sure I fully understand what you are trying to do so I will attempt to cover both possibilities.
The WooCommerce API can be accessed via
https://www.example.com/wc-api/v1/
.Alternatively, WooCommerce is fully loaded by the time
plugins_loaded
is fired (aka when all plugins are done loading). To do something specifically when WooCommerce is loaded you can usewoocommerce_loaded
. Butparse_request
comes afterplugins_loaded
and even comes afterinit
which is where WooCommerce is loading its taxonomies. Are you sure you are using the correct taxonomy names? For example, Attribute taxonomies are preceded bypa_
so a Color attribute would have a taxonomy ofpa_color
.If you adjust your question to clarify what you are doing I might be able to help further.