Well, as a programmer, you will not do this if you think you are expert. But, who know, this is a easiest and fastest way to get the system work well, get all of products of all of categories sort by newest products in 5 minutes without any risk. Actually, this is not really “magento core edit”, we just inherit the core code and override it in local directory, it ‘s fine if we update the core.
Now let ‘s copy app/code/core/Mage/Catalog/Block/Product/List/Toolbar.php to app/code/local/Mage/Catalog/Block/Product/List/Toolbar.php (create a new directory if it is not exists).
Open new file and look at these lines of code in around line 232
if ($this->getCurrentOrder()) {
$this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
}
Now, replace with these lines
if ($this->getCurrentOrder()) {
if(($this->getCurrentOrder())=='position'){
$this->_collection->setOrder('entity_id','desc');
}
else {
$this->_collection->setOrder($this->getCurrentOrder(),$this->getCurrentDirection());
}
}
That ‘s all, now remember to clear all cache and reindex too see the magic.
For more see here.