Custom sorting by new in products on category page and layered navigation in magento

Custom sorting by new in products on category page and layered navigation in magento

If you want to customize your sorting on category page's toolbar section, please follow below given suggested method: Create a custom module for overriding Catalog/Block/Product/List/Toolbar.php For that , you must follow the procudure to create a custom module in magento as:


    
        
            true
            local
        
    


Above code should be placed in your app/etc/modules and name the xml file with Eglobe_Catalog.xml Next step is, remember to add your local/Eglobe/Catalog/etc/config.xml with below given code:
 

    
         1.1.3
    



  
     Eglobe_Catalog_Block
             
  
      
        Eglobe_Catalog_Block_Product_List_Toolbar
      
  




Finally override the Mage_Catalog_Block_Product_List_Toolbar.php file by the following code.
class Eglobe_Catalog_Block_Product_List_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar
{
    /**
     * List of available custom sort types
     *
     * @var array
     */
    public function getAvailableOrders()
    {
        return array(
            'created_at' => $this->__('Date'), //set the sort type by new product came in for category
            'name' => $this->__('Name'),
            'price' => $this->__('Price')
        );
    }    
}

  • Share on Facebook
  • Share on Twitter
  • Share on LinkedIn

leave a comment