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.

asked Feb 13, 2018 at 5:53

1 Answer 1

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.

answered Feb 13, 2018 at 10:08

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.