2

I have added new product and it show at the end of the category page in magento 1.9.2.3. Suppose if i have 2 page of category products than new product show at 2nd page at the end, but i want to show the product at 1st place on 1st page. Anyone know how can i show newly product at 1st place in the category page.

thanks

2

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.

  • Please accept this answer so that others user can get help from right answer – Arunendra May 25 '16 at 5:14
  • Click the checkmark under this post, on the left. ( it's right below the arrows). – Arunendra May 25 '16 at 6:22
  • See this image i.stack.imgur.com/LkiIZ.png – Arunendra May 25 '16 at 6:22

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.