Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $products = Mage::getModel('catalog/product')->getCollection()
- ->addAttributeToSelect('breed','other_field');
- $products->getSelect()
- ->order(new Zend_Db_Expr('e.breed asc, e.other_field desc'));
- foreach($products as $product) {
- var_dump($product->getData());
- }
- SELECT `e`.`entity_id`, `e`.`type_id`, `e`.`attribute_set_id`, `e`.`breed`, `e`.`other_field` FROM `catalog_product_flat_1` AS `e` WHERE (e.status = 1) ORDER BY `e`.`breed` asc, `e`.`other_field` asc
Add Comment
Please, Sign In to add comment