I want to get block name from where price.phtml called.Also I cant find block name from catalog.xml.I fount this function but I don't know block name for this.

<?php echo $this->getPriceHtml($_product); ?>
  • enable block name hint in template path hint not working for this ?? Commented Feb 1, 2017 at 10:31
  • do you want block type or block name ?? Commented Feb 1, 2017 at 10:33
  • template path hint not working thats why i'm asking Commented Feb 3, 2017 at 18:17
  • do you want class name or block type ?? Commented Feb 3, 2017 at 18:26
  • i need block name Commented Feb 3, 2017 at 18:27

3 Answers 3


You can use hints for check block for each template:

or You can use xdebug for check all of it

or You can use this: Mage::app()->getRequest()->getModuleName() fir check module name, and search for block You need

You can also display instance of this in phtml

or use $this->getNameInLayout();


Use this:

$blocks = Mage::app()->getLayout()->getAllBlocks();

This will give you an array with the block instances. To get only the names use this:

$blockNames = array_keys($blocks);

go to price.phtml and add below code to top of file it will show you block name of that file


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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