tags:

views:

421

answers:

2

Hi

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

+1  A: 

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() ?>

Prattski
Thanks. It is not a static block though (I think). It is just the same content that is inserted on any category page. Found from template hints it is either this frontend/default/pfge/template/catalog/category/view.phtml or this: frontend/default/pfge/template/catalog/product/list.phtml that I would like to insert under the cart.
Tillebeck
Then, I'm not quite sure what you are really trying to do. Are you saying you want to have all the content that you would find if you went to view a category or product to be displayed underneath the cart content on the cart page?
Prattski
I think you are right. It is a block. Found it in catalog.xml. I updated my question based on that finding. I also tried to use your answer. Can you help on how to reference the block correctly? Also adding the data that it shall be for category 18 (category_id="18")
Tillebeck
A: 

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 enable to pager / pagination (page 1,2,3,4) to display properly?

SEM Truth