skip to Main Content

What I got so far:

        [
            'wp_api' => true,
            'version' => 'wc/v3',
            'query_string_auth' => true //Force Basic Authentication as query string true and using under HTTPS
            
        ]
    );
        

try {
    $results = $woocommerce->get('orders?per_page=30');
    $result = count($results);

I tried to remove the query_string_auth but I dont get any data displayed.
FYI it works without the page=30 but then only displayed the first 10 items.

Any advice would help alot:

2

Answers


  1. Get method accepts extra parameters.

    $woocommerce->get($endpoint, $parameters = []);
    

    Try like this

    $woocommerce->get('orders', array('per_page' => 30));
    

    More details can be seen here

    Login or Signup to reply.
  2. If you are using Nginx, check your Nginx configurations. Missing Nginx settings will ignore the GET method query parameters. So it might be the issue that your page or per_page parameter are simply being ignored.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search