laravel5-woocommerce-api-client icon indicating copy to clipboard operation
laravel5-woocommerce-api-client copied to clipboard

Undefined index: X-WP-TotalPages

Open ghost opened this issue 5 years ago • 1 comments

Hi friends. I want to fetch all orders and put them in array but this code returns : Undefined index: X-WP-TotalPages

$params = [
           'per_page' => 100,
           'page' => 1
        ];


        $woocommerceorder = Woocommerce::get('orders', $params);
        while (Woocommerce::hasNextPage()) {
                 $params = [
                    'per_page' => 100,
                    'page' => Woocommerce::nextPage()
                 ];
                 $woocommerceorderpart = Woocommerce::get('orders', $params);
                 $woocommerceorder = array_merge($woocommerceorder, $woocommerceorderpart);
        }

any idea ?

ghost avatar Dec 19 '19 20:12 ghost

See my pull request #57 for a fix for this issue.

stromgren avatar Dec 28 '19 18:12 stromgren