kloon / WooCommerce-REST-API-Client-Library

A PHP wrapper for the WooCommerce REST API
GNU General Public License v3.0
356 stars 175 forks source link

How to use ; rel="next", ; rel="last" in my php script? #223

Open ddhara opened 7 years ago

ddhara commented 7 years ago

I am using below code to get orders but only 10 orders coming at a time so how can I get other orders? How can I use :rel = "next", :rel = "last" which I am getting in response?

<?php

require_once( 'lib/woocommerce-api.php' );

$options = array(
    'debug'           => true,
    'return_as_array' => false,
    'validate_url'    => false,
    'timeout'         => 30,
    'ssl_verify'      => false,
);

try {

    $client = new WC_API_Client( 'http://your-store-url.com', 'ck_enter_your_consumer_key', 'cs_enter_your_consumer_secret', $options );

    $data = $client->orders->get();

}

?>