3

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 ?? – Murtuza Zabuawala Feb 1 '17 at 10:31
  • do you want block type or block name ?? – Murtuza Zabuawala Feb 1 '17 at 10:33
  • template path hint not working thats why i'm asking – Ketan Borada Feb 3 '17 at 18:17
  • do you want class name or block type ?? – Murtuza Zabuawala Feb 3 '17 at 18:26
  • i need block name – Ketan Borada Feb 3 '17 at 18:27
4

You can use hints for check block for each template:
http://insync.co.in/how-to-enable-template-path-and-block-name-hints-in-magento-commerce/

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();

3

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);
2

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

$this->getNameInLayout();

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.