I saw a lot of tutorials about custom header/footer, or even custom section header, but they were creating controls programatically, in this tutorial I want to show how easy is to use Interface Builder to achive same result.
Tag: custom
Sorting custom collection in Magento
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:
1 2 3 4 5 6 |
$items = Mage::getModel('module/model') ->getCollection() ->setOrder('date_added', 'DESC') ->addFieldToFilter('category_id', array('eq' => $category_id)) ->setPageSize($pageSize) ->setCurPage($currentPage); |