i want to call other layout and block in my phtml

Block Name:-catalog/product_view

Layout handle:-catalog_product_view

i have used below code but it's not working.


Can any one help me on this problem ?

Any references or suggestions are highly appreciated.

  • What is ur exact acquirement? – Amit Bera Apr 26 '17 at 9:20
  • i want to print $this->getTierPriceHtml() in my template, for $this i want to call that layout and block. @AmitBera – Kamlesh Jha Apr 26 '17 at 9:23
  • on which page ? – Amit Bera Apr 26 '17 at 9:27
  • on my custom template.@AmitBera – Kamlesh Jha Apr 26 '17 at 9:28

1) On phtml files

$this->getLayout()->createBlock('core/template')->setTemplate('template path')->toHtml(); // change the block type as per your need and change the template path as well.

2) From layout xml

    <block type="your block" name="name">
     <block type="core/template" name="name here" as="alias here" template="path/here/test.phtml"/>

Now call the file inside your block. you can call like this $this->getChildHtml(alias name);


You can try this

But you should be send few params

$productObject =Mage::getModel('catalog/product')->load('[ProductID]');
$block= Mage::app()->getLayout()->createBlock('catalog/product_view')

// gerenarate html

 echo $block->toHtml()

Also note: product $productObject should be full product object

  • what is $productObject ? – Kamlesh Jha Apr 26 '17 at 9:40
  • means object of product :D . Object of this class Mage_Catalog_Model_Product . +1 from me. – Kingshuk Deb Apr 26 '17 at 9:40
  • yes, need to send product object – Amit Bera Apr 26 '17 at 9:42
  • I can only pass the product id or name can you please explain little more.i am beginner in magento. – Kamlesh Jha Apr 26 '17 at 9:50
  • No, you cannot product id .. need to send product means $productObject =Mage::getModel(''catalog/product')->load('productId'); – Amit Bera Apr 26 '17 at 9:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.