How to change the number of columns in Magento catalog grid

The default Magento catalog grid is set to display 3 products per column. Most users alter the number of columns by modifying the file catalog/product/list.phtml. There’s actually a much cleaner approach to this task and you only need to modify an XML file.

Open the catalog.xml file which can be found in the location below:
/app/design/frontend/<package-name>/<theme>/layout/catalog.xml

Locate the line that declares the block for product listing similar to the one below:
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">

Immediately after the code above, add the XML node below:
<action method="setColumnCount"><columns>4</columns></action>

Save the file and clear the contents of your var/cache directory.ย Reload the catalog page to see the changes ๐Ÿ™‚

Note: You can also apply this to catalogsearch.xml or any layout XML file that uses the list.phtml

About the author

Richard Feraro is a Magento Enterprise Certified developer from Manila, Philippines with 14 years of solid open-source development experience using Linux, Apache, MySQL & PHP.

Leave a Reply