By default Magento package does not come with category will show new product in that case you need to do simple modification and you are done.

Step 1: To Achieve this copy the file Toolbar.php from app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php. Create a Directory Structure in local and paste the Toolbar.php as shown below app/code/local/Mage/Catalog/Block/Product/List/Toolbar.php

Step 2: Around line 232 you should see the below code in setCollection function

if ($this->getCurrentOrder()) {
  $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
}

Replace the above code with the new code given below

if ($this->getCurrentOrder()) {
  if(($this->getCurrentOrder())=='position'){
      $this->_collection->setOrder('entity_id','desc');
  }
  else {
   $this->_collection->setOrder($this->getCurrentOrder(),$this->getCurrentDirection());
  }
}

 

Leave a Reply

Your email address will not be published. Required fields are marked *