May
21
2014

Setting all products to list by default in Magento category pages

If you have a smaller Magento store with a relatively small number of products and categories, it can be useful to customers to list all products per category in one page in Magento.

Luckily, setting all products to list in a category by default is quite an easy change to achieve in Magento. The changes require edits to your theme’s local.xml file (e.g., in /app/design/frontend/default/your-theme/layout). If this file doesn’t exist in your theme, you can create it. In older versions of Magento (~1.3 and earlier), make these changes in the catalog.xml file.

I’ve highlighted the changes required to your theme’s local.xml file below:

<catalog_category_default translate="label">
<reference name="content">
<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
<action method="setDefaultListPerPage">
<limit>all</limit><label>All</label>
</action>

<action method="setDefaultGridPerPage">
<limit>all</limit>
<label>All</label>
</action>

<action method="addPagerLimit"><mode>list</mode><limit>10</limit></action>
<action method="addPagerLimit"><mode>list</mode><limit>20</limit></action>
<action method="addPagerLimit"><mode>list</mode><limit>30</limit></action>
<action method="addPagerLimit" translate="label"><mode>list</mode><limit>all</limit><label>All</label></action>
<action method="addPagerLimit"><mode>grid</mode><limit>12</limit></action>
<action method="addPagerLimit"><mode>grid</mode><limit>16</limit></action>
<action method="addPagerLimit"><mode>grid</mode><limit>24</limit></action>
<action method="addPagerLimit" translate="label">
<mode>grid</mode>
<limit>all</limit>
<label>All</label>
</action>
</block>
</reference>
</catalog_category_default>

Don’t forget to refresh Magento’s caches if you have them enabled, in the System > Cache Management menu.

Need a hand with Magento? We offer Magento support and consultancy for businesses of all sizes.