widget – How to Call Custom PHTML File in Widget

widget

I currently call a custom phtml file in CMS pages to display a single product with description, price etc.

 {{block type="catalog/product" product_id="7160" template="catalog/product/dynamic-product-image_howto.phtml"}}

I'm trying to include this in a custom widget – is it possible to call in phtml?

Best Answer

not sure if this is what you need, but give it a try.
In the phtml for your widget do this:

$block = Mage::app()->getLayout()->createBlock('catalog/product')->setProductId(7160)
       ->setTemplate('catalog/product/dynamic-product-image_howto.phtml');

echo $block->toHtml();
Related Topic