cancel
Showing results for 
Search instead for 
Did you mean: 

Add new template to product list products

Add new template to product list products

Hi Guys!

 

Been stuck on something for nearly 4 days which I thought was simple!

Im trying to include and new template called attricon.phtml file into list.phtml.

 

I want the new template to hold only attribute information to display on the products that appear on list pages, results etc.

 

Heres the problem:

 

if I add this: <?php echo $_product->getAttributeText('manufacturer');?> directly to list.phmtl its displays fine.

 

However, if I add the above to my new template (attricon.phtml) and then call it inside the list.phtml, does not work at all!

 

Please help!!

 

Thanks : )

2 REPLIES 2

Re: Add new template to product list products

Have you added block for custom template under layout file? what is the block type you have used for it?

Re: Add new template to product list products

You should transmit product object to your block and try to access it. You shouldn't use variable because it may not exist. If your block is a direct descendant of the list block and called with the code (not with the help of layout), then you can try to do $childBlock->setProduct($_product); and then draw it, using inside the block to achieving product $this->getProduct(); instead of using variable. If you are using layout to add your block, you have to care about data transition. You can use register (Mage::registry() & Mage::register()) or try to get data from the parent block using $this->getParentBlock(); and get data from it.