Source : How to change product column quantity in Magento.
Hi pals!, looking for tips to customize your theme?, here’s one very useful and easy to do: How to change the product column quantity in your product list pages. We’ll modify only 2 files:
- app/design/frontend/default/yourtheme/layout/catalog.xml
- app/design/frontend/default/yourtheme/template/catalog/product/list.phtml
catalog.xml :
Find “Category layered navigation layout” section or “Category default layout” section (if you don’t use layered-nav in your category pages), then add this lines or modify the exisitng ones if you already have them:
1 2 3 |
<reference name=”root”> <action method=”setTemplate”><template>page/1column.phtml</template></action> </reference> |
Why we do this?: we set 1column layout in category pages since we want to take advantage of the full width of the page, so we can set 4 columns of products (grid mode of course). But it’s not mandatory, you can choose between 1column,2columns-right,etc. to fit your needs.
list.phtml :
Find this line under <?php // Grid Mode ?>
section:
1 |
<?php $_columnCount = $this->getColumnCount(); ?> |
Change it to:
1 |
<?php $_columnCount = 4 ?> |
Save all files, clear your Magento cache. That’s it, you’ll get a category list with 4 columns of products.