It seems to be trivial, but it’s not. If you want to use custom table and custom model, and sort collection by one of your table’s column, you can’t just use addAttributeToSort as you do with native Magento collection (like “catalog/product”). Instead of this, you should use setOrder, so your code should look like this:
$items = Mage::getModel('module/model') ->getCollection() ->setOrder('date_added', 'DESC') ->addFieldToFilter('category_id', array('eq' => $category_id)) ->setPageSize($pageSize) ->setCurPage($currentPage);
love this site – it’s a great blog – may i suggest you get an rss feed.
great points altogether, you just gained a new reader. What would you suggest in regards to your post that you made some days ago? Any positive?
Thanks so much, was looking for hours
Very useful post. Thanks a lot…..
I read a lot of interesting content here. Probably
you spend a lot of time writing, i know how to save you a lot of time, there
is an online tool that creates unique, google friendly articles in seconds, just search in google
– laranitas free content source