1

I am using the following code to fetch category tree where almost i want to fetch around 1000 records but only getting 100 records because of limit.

$resourceUrl = "$apiUrl/categories/store/default?limit=100";

Here limit=100 is the maximum value if it exceed, like

$resourceUrl = "$apiUrl/categories/store/default?limit=101";

it is giving the following error

enter image description here

Please help me to get through this problem and provide solution to increase this limit to 1000 or more vlaue.

1

If you look in the \Mage_Api2_Model_Resource::_applyCollectionModifiers method, you will see that the limit is hardcoded :

if ($pageSize != abs($pageSize) || $pageSize > self::PAGE_SIZE_MAX) {
        $this->_critical(self::RESOURCE_COLLECTION_PAGING_LIMIT_ERROR);
}

with const PAGE_SIZE_MAX = 100;

So, unless you rewrite this class, you will not be able to bypass this limit.

I think you should use the param page to get all the 1000 products you want :

get the 100 first with $resourceUrl = "$apiUrl/categories/store/default?limit=100&page=1";

then $resourceUrl = "$apiUrl/categories/store/default?limit=100&page=2";

to get the product between 100 and 200 of the collection, etc, etc until page=10.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.