Working on magento 1 website.

I want to sort the product sorting by new in all product categories. So that when any new product is added that shows on first.

Can i be please guided how can same be done.

  • You can sort the field created_at. – kiatng Aug 25 '18 at 4:11

Rewrite Toolbar block in your custom module



Now create your custom block which rewrites the Toolbar block.


class Vendor_Module_Block_Catalog_Product_List_Toolbar extends Mage_Catalog_Block_Product_List_Toolbar
    public function setCollection($collection)
        $this->_collection = $collection;


        // we need to set pagination only if passed value integer and more that 0
        $limit = (int)$this->getLimit();
        if ($limit) {
        if ($this->getCurrentOrder()) {
            else {
                $this->_collection->setOrder($this->getCurrentOrder(), $this->getCurrentDirection());
        return $this;

    public function setDefaultOrder($field)
        if (isset($this->_availableOrder[$field])) {
            $new = ['new' => 'New'];
            $this->_availableOrder = $new + $this->_availableOrder;
            //$this->_orderField = $field;
            $this->_orderField = 'new';
        return $this;
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.