0

I have created my own small extension to handle what is displayed for the in-stock and out-of-stock messages.

In the layout file MyModule_Availability.xml I have

<PRODUCT_TYPE_simple>
    <reference name="product.info.simple">
        <action method="setTemplate">
            <template>MyModule/Availability/catalog/product/view/type/default.phtml</template>
        </action>
    </reference>
</PRODUCT_TYPE_simple>

which works like a charm.

But that is only the individual product. I want to display the same changes in list and grid mode as well.

So I am trying to find what I need to put around

    <action method="setTemplate">
        <template>MyModule/Availability/catalog/product/list.phtml</template>
    </action>

For my list.phtml to be used.

When I display handleinformation in the shop I get the following:

frontend/default/ma_erida/template/catalog/product/list.phtml

Mage_Catalog_Block_Product_List

I hope you can help.

1 Answer 1

4

Using the handles: catalog_category_default, catalog_category_layered and catalogsearch_result_index you should be able to change the template of the products list.

For the two category layout handles you would need the following snippet.

<catalog_category_default>
    <reference name="product_list">
        <action method="setTemplate">
            <template>MyModule/Availability/catalog/product/list.phtml</template>
        </action>
    </reference>
</catalog_category_default>
<catalog_category_layered>
    <reference name="product_list">
        <action method="setTemplate">
            <template>MyModule/Availability/catalog/product/list.phtml</template>
        </action>
    </reference>
</catalog_category_layered>

But for the search results page you would need to make a slight change as the block is not called product_list but search_result_list:

<catalogsearch_result_index>
    <reference name="search_result_list">
        <action method="setTemplate">
            <template>MyModule/Availability/catalog/product/list.phtml</template>
        </action>
    </reference>
</catalogsearch_result_index>
1
  • Sorry for not comming around to this in over a year. Different job, different tools, quite hectic phase of my life.
    – Bent
    Commented Oct 29, 2015 at 13:58

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.