Magento – Tracking Down a getChildHtml Template File

htmlproducttemplate

I have been asked to make a seemingly simple change to a magento product page but I am having trouble tracking down the file.

The file template/catalog/product/view.phtml contains the line

echo $this->getChildHtml('product_additional_data')

I want to change the child html (or at least see it to find out if it is the file I'm after) but I can't find where it's coming from.

I have looked at the catalog.xml file and it contains the following block:

<block type="catalog/product_view_additional" name="product.info.additional" as="product_additional_data" />

Should it not have a template="something.phtml" attribute to tell me where to go?

It displays (I think) a table with tabs for "Product Description", "Additional Information" and "Product's Reviews".

Thanks

Best Answer

Often block will have default templates set in the block. In your example this is the case.

If you look in the file Mage_Catalog_Block_Product_View_Additional you will see the setting of the template.

public function __construct()
{
    parent::__construct();
    $this->setTemplate('catalog/product/view/additional.phtml');
}

A great way of finding these template is by setting template hints via the admin.

Related Topic