Guest User

Untitled

a guest
Jan 19th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. $products = Mage::getModel('catalog/product')->getCollection()
  2. ->addAttributeToSelect('breed','other_field');
  3.  
  4. $products->getSelect()
  5. ->order(new Zend_Db_Expr('e.breed asc, e.other_field desc'));
  6.  
  7. foreach($products as $product) {
  8. var_dump($product->getData());
  9. }
  10.  
  11. 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