I can call the .phtml file in my .phtml template like list.phtml.
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('goodtest/test.phtml')->toHtml(); ?>
But in test.phtml I cannot call the values ββof $ _product.
For example:
<?php $_productCollection=$this->getLoadedProductCollection(); foreach ($_productCollection as $_product): ?>
work
<?php echo $_product->getName() ?>
does not work:
<?php echo $this->getLayout()->createBlock('core/template')->setTemplate('goodtest/test.phtml')->toHtml(); ?>
In the file: test.html: <?php echo $_product->getName() ?> .
Should I load the complete collection into the product again in each included file, how can I get the $ _product values ββin test.phtml in the most efficient way?
object php magento
Martin
source share