Hi All,
Figured I’d share a quick Magento snippet (There are several I’d like to share each day. For some reason this particular one seemed quick enough to post).
Want to change the number of products that display in the Magento Category listing?
You’ll need to modify these two files:
- app/design/frontend/default/YourThemeName/layout/catalog.xml (default theme line 198)
- app/design/frontend/default/YourThemeName/layout/catalogsearch.xml (default theme line 61)
See the screenshot for the variable columnCount()? In order to change that, go to the following file and add in this snippet:
- app/design/frontend/default/YourThemeName/layout/catalog.xml (default theme line 198)
<action method="setColumnCount"><columns>3</columns></action> <!-- set your own number -->
And also this snippet:
- app/design/frontend/default/YourThemeName/layout/catalogsearch.xml (default theme line 61)
<action method="setColumnCount"><columns>3</columns></action> <!-- set your own number and insert <em>inside</em> the "search_result_list" block tags-->
Jerry says
It should be noted that sometimes this does not work if the template is customized, in which case view.phtml must be editted directly.
Mara says
Not working for me in v1.4.0.1.
Brady says
How would I apply this methodology to easily update a CMS page through CMS > Manage Pages > Custom Design > Layout Update XML? I tried inserting the code above, but it didn’t work.
Thanks!
Alex Margineanu says
thanks for the tips.
Florian Böhme says
how can i edit the home page/start page grid layout? the grid columns count of all sites is 4, but the front page is 3. i cant find the place to edit it 🙁
Jan Chr says
Have the same problem. I only need to modify the number of products shown on the home page (new products).
Munapooja says
dfaf////for display more then 3 product on product or homepage in magento/////
change code in app/design/frontend/base/default/template/catalog/product/list/phtml
line 87//gridview
line 90 change code
getColumnCount(); ?> apply this under code to it.
Munapooja says
line 87//gridview
line 90 change code
getColumnCount(); ?> apply this under code to it.