The goal is to append a block, after the product price, on the product view page using an observer.

To this moment, I was able to:

  • clone the catalog/product_price
  • set the clone as a child-block
  • and set a custom type and template for it

The issue is, that there are additional blocks on the page, that include a catalog/product_price block. Tier-prices and related products namely. I would like exclude them from the block cloning and child addition process.

the relevant config.xml part:


the observer:

    class Namespace_Modulename_Model_Observer {

    public function insertBlock($observer){

        $_block = $observer->getBlock();
        $_type = $_block->getType();
        if ($_type == 'catalog/product_price') {
            $_child = clone $_block;
            $_block->setChild('kiddo', $_child);

the current frontend output of said module

How would you advise to do that, preferably in canonical Magento API way ?

  • 1
    Any reason why you are doing this via an observer and not layout xml? Commented Oct 24, 2014 at 11:54
  • Hi, it needs to be done via extension and to be theme independent ... Commented Nov 10, 2014 at 15:44
  • You can add a layout file as a resource with an extensions config.xml. Put your layout xml under base/default which all themes fallback to and it will always be applied (and thus be theme independent). Commented Nov 10, 2014 at 15:49

1 Answer 1


This is not the preferably way to extend the default magento layout. Its better to use the layout xml in your theme folder. This is not very efficient because this event is fired a lot of times on all the magento pages.

Its better to use something like this:

<catalog_product_view translate="label">
   <reference name="product.clone_prices (or some other block)">
      <block type="some/block" name="kiddo" template="namespace/modulname/additional.phtml">

Then add in your custom template the following line:

<?php echo $this->getChildHtml('kiddo'); ?>
  • Hi, thanks for the reply, but it needs to be done via extension and to be theme independent. Commented Nov 10, 2014 at 15:43

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.