Skip to content

Instantly share code, notes, and snippets.

@forshariq
forshariq / List.php
Created June 12, 2011 05:07
Override Core Modules Mage/Catalog/Block/Product/List.php
<?php
class MyCompany_Catalog_Block_Product_List extends Mage_Catalog_Block_Product_List{
/*override this function*/
protected function _getProductCollection(){
/*Add below line to add existing line of code to display stock in descending order*/
$this->_productCollection = $layer->getProductCollection()->addAttributeToSort('created_at','DESC');
}
?>