Magento Forum

   
How to sort this ? 
 
vicek
Jr. Member
 
Total Posts:  12
Joined:  2008-06-16
 

$products   $product->setStoreId($storeId)->getCollection()
            ->
addAttributeToFilter('home_page_featured', array('yes'=>true))
            ->
addAttributeToSelect(array('name''price''small_image'), 'inner')
            ->
addAttributeToSelect(array('special_price''special_from_date''special_to_date'), 'left')
        ;
How to sort this by product_id DESC ? smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
vicek
Jr. Member
 
Total Posts:  12
Joined:  2008-06-16
 

->addAttributeToSort(’product_id’,’desc’) doesnt work :[

 
Magento Community Magento Community
Magento Community
Magento Community
 
Unirgy
Guru
 
Avatar
Total Posts:  478
Joined:  2007-09-07
 

try: ->addAttributeToSort(’entity_id’,’desc’)

 
Magento Community Magento Community
Magento Community
Magento Community
 
vicek
Jr. Member
 
Total Posts:  12
Joined:  2008-06-16
 

awsome! it works
thank you <3

 
Magento Community Magento Community
Magento Community
Magento Community
 
blackpr
Jr. Member
 
Total Posts:  5
Joined:  2009-09-04
 

Thank you @Unirgy.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top