I cannot seem to find a way to access the X-WP-TotalPages in the header of the response, I am able to display my orders and everything the way I want to but for the life of me cannot figure out how to get to the headers in the response.
I am using this at the moment;
require($_SERVER["DOCUMENT_ROOT"] . "/vendor/autoload.php");
use Automattic\WooCommerce\Client;
$woocommerce = new Client(
'http://example.com',
'**********************************',
'**********************************',
[
'wp_api' => true,
'version' => 'wc/v1',
]
);
$endpoint = 'orders';
$options = ['filter[limit]' => '200', 'filter[period]' => 'year', 'filter[order]' => 'ASC', 'status' => 'processing'];
$result = $woocommerce->get($endpoint, $options);
I am pretty certain I need something along the lines of this;
print_r(get_headers($result['X-WP-TotalPages']));
I have tried a number of different variations but just cannot seem to figure it out, any help would be massively appreciated!