0

In magento I am writing one module. In my module lets say I have mymodule.xml where I want to insert my own block after this block

<catalog_product_view>
    <reference name="product.info">
      <block type="test/test" name="test" as="other" template="test/test.phtml" >
        <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" />
      </block>
    </reference>
  </catalog_product_view>

This one is working fine in product details view page but when I am trying to show the same block in product category view and list view its not working at all. The product list category is like this where I am inserting my code from mymodule.xml

    <catalog_product_list>
    <reference name="product.info">
       <block type="test/test" name="test" as="other" template="test/test.phtml" >
        <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" />
      </block>
    </reference>
  </catalog_product_list>

When I am going to check the changes in list view I can't see any changes (after clearing cache). So can someone kindly tell me how to solve this issue. Any help and suggestions wll be really appreciable. Thanks..

2

The issue here is that the layout handle catalog_product_list doesn't exist. At least, not unless you created it. But by default that handle is non-existent.

What it sounds like you're looking for is to display it on the category pages. In that case, you're in a little bit of bad luck; there is no product.info block on these pages. You can instead create your block as such:

<catalog_category_layered>
    <reference name="product_list">
       <block type="test/test" name="test" as="other" template="test/test.phtml" >
        <block type="test/test" name="test_info" as="test_info" template="test/testinfo.phtml" />
      </block>
    </reference>
</catalog_category_layered>

If you're not using layered navigation, change that to catalog_category_default.

Then, in your catalog/product/list.phtml you will want to add the following echo statement inside of the product listing div:

echo $this->getChildHtml('test_info);
  • still its not showing.... – NewUser Sep 6 '13 at 6:48
  • still its not working – NewUser Sep 12 '13 at 7:43

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.