Magento – Products on homepage: get more than 12 products

blockscatalogmagento-1.9.1.1productproduct-list

Im trying to show a few products on my homepage

I got pretty far using this code:

{{block type="catalog/product_list" name="product_list" category_id="74" column_count="5" num_products="24" mode="grid" template="catalog/product/list.phtml"}}

I also added a display: none; to the css to remove the option and filter thing from the product vieuw block. to let it look more natrual on the homepage

<style><!--
.cms-home .pager, .cms-home .sorter, .toolbar, .pager {
    display: none;
}
--></style>

But my problem is: i can't get more products on it as my average 12.

I already tried:

1>> I tried to let the catolog page use an diffrent "show amount" so instead of 12 i changed it to use 36 with the custom xml bellow. this worked on the catolog path (wich is now offline) but does not work with my block on the homepage (also tried to add this custom xml to the homepage)

<reference name="product_list_toolbar">
 <action method="setDefaultGridPerPage">
<limit>36</limit></action></reference>

2>> I tried alot of extra block options but none of them seems to take effect. few of them are bellow: (there are a few more as this but i cant find them anymore, aslo tried it on amount 36)

products_per_page="50" products_count="50" count="9" limit="9" num_products="24"

3>> edit also tried the following blocks

<p>{{block type="catalog/product_list" name="product_list" category_id="74" column_count="5" count="24" limit="24" mode="grid" template="catalog/product/list.phtml"}}</p>
<p>{{block type="catalog/product_list" name="product_list" category_id="74" column_count="6" count="6" limit="4" mode="grid" template="catalog/product/list.phtml"}}</p>
<p>{{block type="catalog/product_list" name="product_list" alias="products_homepage" category_id="74" template="catalog/product/list.phtml"}}</p>
<p>{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="74" column_count="6" products_per_page="50" products_count="50" count="9" limit="9" num_products="24" template="catalog/product/list.phtml"}}</p>
<p>{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="9" template="catalog/product/list.phtml"}}</p>

4>> edit Tried the following custom xml code:

<reference name="content">
    <!-- Overwrite the view template -->
    <block type="catalog/product_list" template="catalog/product/list.phtml">
      <action method="setLimit">36</action>
 </block>

5>> edit Products per page on grid allowed values.
I got 12,24,36 because i need column=3 on my product page with 4 bellow each other.

question: Does anyone knows how to get more as 12 products with this block? or get around it on a different way.

Best Answer

Go to the homepage in the CMS -> Manage pages and add the following code snippet into the editor there

You could also use the same code to drill down into a specific category, by adding the category variable, e.g. be aware that here you have list_custom.phtml so you need to copy this there and just copy the list.phtml.

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="9" template="catalog/product/list_custom.phtml"}}

1) app\design\frontend\default\<your theme>\template\catalog\product copy list.phtml and save as list_custom.phtml

2) Now open list_custom.phtml and search for the following snippet. I have edited the $_columnCount = 4 as I want 4 products in one row and I have 4 products to show in the line if($i == 4) break;. So for you you will need the columntcount you want and then 36 as a break.

<?php // Grid Mode ?>
<?php $_collectionSize = $_productCollection->count() ?>
<?php //$_columnCount = $this->getColumnCount(); ?>
<?php $_columnCount = 4; ?>
<?php $i=0; foreach ($_productCollection as $_product): ?>
<?php 
$_productId = $_product->getId();?>
<?php if($i == 4) break; ?>
<?php if ($i++%$_columnCount==0): ?>
<ul class="products-grid row">
Related Topic