Domanda

I have a magento page here. On my home page the products show from the category id 29. I want to add 5 also into it. I prefered using cms--> pages--> design... here is my design xml code

<reference name="content">
<block type="catalog/product_list" name="home" template="catalog/product/list.phtml">
<action method="setCategoryId"><category_id>29</category_id></action>


<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
<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"/>
 </block>
<action method="setToolbarBlockName"><name>product_list_toolbar</name><count>5</count></action>
</block>
 </reference>

I have changed it into

<reference name="content">
<block type="catalog/product_list" name="home" template="catalog/product/list.phtml">
<action method="setCategoryId"><category_id>29</category_id></action>
<action method="setCategoryId"><category_id>5</category_id></action>


<action method="addColumnCountLayoutDepend"><layout>one_column</layout><count>5</count></action>
<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"/>
 </block>
<action method="setToolbarBlockName"><name>product_list_toolbar</name><count>5</count></action>
</block>

and I even tried it using ,.

Can any one help me?

È stato utile?

Soluzione

The block catalog/product/list will only load one category $category = Mage::getModel('catalog/category')->load($this->getCategoryId());. You can overwrite and edit Mage_Catalog_Block_Product_List or try:

 {{block type="catalog/product_list"  category_id="29" template="catalog/product/list.phtml"}}
 {{block type="catalog/product_list"  category_id="5" template="catalog/product/list.phtml"}}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top