Magento custom collection filter and sort
We have already know how to filter magento product ,customer,wishlist,order collection fields filters.
But whenever we are working on non-exiting model collection, then we facing problem.Here i have put some tricks how you can filter a custom collection by a field.In post,i have working on a writing how a custom collection is filter by a filed and how the collection will filter.
Suppose a custom collection is
addFieldToSelect('*') at that Collection for retrieves all field value for a module is
Then want to filter that collection by a field name ‘age’ then use
For add for sort by a specific field then add
Example want to sort by age descending then try this
for fetch limit number of rows of a collection use