I have already used WooCommerce api on a specific page in practice. Understood with how the request path should look. If the page has such a path https://site.com/page , then it’s enough for me to make such a query path /../products , but what can I do if I cannot be sure which page will be is open? For example: in the case where the code is in the function.php file
I have a function that should be attached to the hook, but I don’t know how to specify the correct query path inside this function.
function test_callback($order_id, $old_status, $new_status) { if( $new_status == "processing" ) { var_dump($woocommerce->get("/orders/$order_id")); //неправильный путь } } add_action( 'woocommerce_order_status_changed', 'test_callback', 10, 3); Perhaps what I want to do is a more elegant way, in any case I would like to know how this could be implemented.