开发者

magento insert product list for category 18 under cart

In Magento under the cart I would like to insert the products for category 18 just as they are listen on any ordinary product page.

I can see how to insert a block on a CMS page. But how to I call the template(?) for product listing below the cart?

BR. Anders

UPDATE: Can see that the file layout/catalog.xml has this block that probably is the one I wish to insert on the cart page:

<block type="catalog/category_view" name="category.products" template="catalog/category/view.phtml">

I have tried to copy it and insert in different ways into the catalog.xml under cart and tried to insert the开发者_运维问答 block into cart.phtml. Cannot figure out how to do it based on the answer below (I am obviously new to modifying Magento)

UPDATE 2: Had it been on a CMS page then it should just be this line.

{{block type="catalog/product_list" category_id="4" template="catalog/product/list.phtml"}}

So I am just looking for the equivalent when going into cart.phtml or into layout/checkout.xml. Thanks


Just get the identifier of the static block, then put this code in your template:

<?php echo $this->getLayout()->createBlock(’cms/block’)->setBlockId(’my-identifier’)->toHtml() ?>


<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
<action method="setCategoryId"><category_id>18</category_id></action>
</block>

using this in the layout file should work.


I have used method or update #2 a number of times:

{{block type="catalog/product_list" category_id="4" template="catalog/product/list.phtml"}}

However, how are you able to make pagination (page 1,2,3,4) display properly?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜