I'd like to call $this->getChildHtml('product_type_data')
to get product's price outside view.phtml template file.
Currently I have echo $this->getChildHtml('product_type_data')
and that outputs contents of 'catalog/product/view/type/default.phtml'.
I need to move it to a file in a custom module(cache hole punch) so that it gets called separately. So in this file I've done:
$block = Mage::app()->getLayout()->createBlock('customerprices/catalog_product_view', $this->getId());
$block->setTemplate('catalog/product/view/type/default.phtml');
$block->setIsLoggedIn(Mage::getSingleton('customer/session')->isLoggedIn());
$out = $block->getChildHtml('product_type_data');
But in this case $out contains an empty string. Do I need to set something on this block so that it will return price html? If so how? I have a current $_product object if that's needed.
I would appreciate any suggestions.
Using Mage::getBlockSingleton(...)
when I use this code:
$thatx = Mage::getBlockSingleton('catalog/product_view');
$cnamex = get_class($thatx);
echo 'cname: '.$cnamex;
$cnamex does not contain class name(empty string/variable). I consequence I can't run any methods on it.