Magento WizardNo joke, this website relaunches on 1st April. New look, new features!

Contact the site  Make Money

Order Products by SKU on the Category or Home Page

 Add to Favourites  
(No Ratings Yet)
Loading ... Loading ...

Someone wrote in recently with regards to wanting to have the products on the category page ordered by SKU rather than alphabetically, or by ID. This is indeed possible, and it’s just a quick change of a template that can enable this to happen…

Just navigate to your app/code/core/Mage/Catalog/Block/Product/list.php folder and ensure the following code is present around line 60 (it should replace the existing block):

1
2
3
4
5
6
7
8
9
10
if ($this->getCategoryId()) {
$category = Mage::getModel(’catalog/category’)->load($this->getCategoryId());
$layer->setCurrentCategory($category);
}
$this->_productCollection = $layer->getProductCollection()
}
return $this->_productCollection;
change $this->_productCollection = $layer->getProductCollection()
on
$this->_productCollection = $layer->getProductCollection()->setOrder(’sku’, ‘asc’);

Note the bottom line – this is what determines the order of products. Give it a go, and let me know if you have success with this modification.

  • Digg
  • del.icio.us
  • Facebook
  • Google
  • LinkedIn
  • Live
  • Reddit
  • StumbleUpon
  • Technorati
  • TwitThis

about the author

    This article was written by Sam Davis on January 14, 2009.
    Computing over a glass of Grenache Shiraz... again!
    Sam is the Editor of Blasted Thing. Contact Us

related articles

 Creating Magento Landing Pages - Video Guide
 Display custom static text block on home page - Video Guide
 Display Products on Magento Home Page - Video Guide

comments

Leave a Reply




Spam protection by WP Captcha-Free


Display Custom Static Text Block on Home Page – Video Guide

  • Sponsored Ads

  • Magento Themes
    • vtiger: great article, thank you....
  • Recent Tweets

    Magento Expert Required by shoppingnirvana http://bit.ly/coWXrg #Freelance jobs

    Não Perca! Curso Templates Magento - RJ dia 26/03 - Inscreva-se -> http://ow.ly/1p4o6 @cursodeecommerc #cursomagento

    I need a magento expert for the tasks below: 1. fix search functionality and free shi... http://tinyurl.com/yg9ns3r #php #job Follow Me

    #jobs #freelance Magento Expert Required by shoppingnirvana: I need a magento expert for the task... http://bit.ly/bBuFRa #webdesigner #web

    architecture:: Magento Expert Required by shoppingnirvana http://www.freelancer.com/projects/iPhone/SMS-Delay-iPhone-Jailbroken-App.html