2Parale / 2Performant-php

PHP Wrapper for the 2Performant API
2 stars 1 forks source link

Get products feed issue #24

Closed izdrail closed 5 years ago

izdrail commented 5 years ago

Hy I'm using 'getAffiliateProducts' to get the affiliate products from a feed but the thing is I only get 20 results. Is there any way to increase the number of results that I get? I had a look to the core but I don't find anything related to pagination. Can you direct me in the right way?

tetele commented 5 years ago

Try something like

$filter = new AffiliateProductFilter();
for($page = 1; $page <= $numPages; $page++) {
  $products = $api->getAffiliateProducts($auth, $productFeed, $filter->page($page));
}

The method is defined here https://github.com/2Parale/2Performant-php/blob/master/src/Filter/CollectionFilter.php