3

I need to remove a block which is called in catalog.xml:

<PRODUCT_TYPE_simple translate="label" module="catalog">
    <label>Catalog Product View (Simple)</label>
    <reference name="product.info">
        <block type="catalog/product_view_type_simple" name="product.info.simple" as="product_type_data" template="catalog/product/view/type/default.phtml">
            <block type="core/text_list" name="product.info.simple.extra" as="product_type_data_extra" translate="label">
                <label>Product Extra Info</label>
            </block>
        </block>
    </reference>
</PRODUCT_TYPE_simple>

I tried it in my own local.xml with following code. But both don't work:

<?xml version="1.0" encoding="UTF-8"?>
<layout>
<PRODUCT_TYPE_simple>
<reference name="product.info">
<remove name="product.info.simple"/>
</reference>
</PRODUCT_TYPE_simple>
</layout>



<?xml version="1.0" encoding="UTF-8"?>
<layout>
<catalog_product_view>
<reference name="product.info">
<remove name="product.info.simple"/>
</reference>
</catalog_product_view>
</layout>

Thank you for your help!

2
  • Why is the code duplicated?
    – mbalparda
    Jul 15, 2014 at 11:07
  • Why is there two snippets in the file? Jul 15, 2014 at 11:57

6 Answers 6

10

You don't need to write layout xml for this as it is available

Magento->admin->Stores->Configuration->Catalog->Inventory

Simply set Display Products Availability in Stock on Storefront to No.

1

You can try this

<?xml version="1.0" encoding="UTF-8"?>
    <layout>
        <PRODUCT_TYPE_simple>
            <reference name="product.info">
                <action method="unsetChild"><name>product.info.simple</name></action>
            </reference>
        </PRODUCT_TYPE_simple>
    </layout>

with reference to this answer https://stackoverflow.com/questions/16937018/magento-remove-block-using-update-xml

0

Comment this code in your catalog.xml

         <reference name="product.info">
            <block type="catalog/product_view_type_simple" name="product.info.simple" as="product_type_data" template="catalog/product/view/type/default.phtml">
                <block type="core/text_list" name="product.info.simple.extra" as="product_type_data_extra" translate="label">
                    <label>Product Extra Info</label>
                </block>
            </block>
            <block type="catalog/product_view_type_simple" name="product.info.availability" as="product_type_availability" template="catalog/product/view/type/availability/default.phtml" />
        </reference>
1
  • Thank you! I didn't want to overwrite the theme but if its the only possibility I'm gonna do that.
    – Stefan
    Jul 15, 2014 at 12:39
0

If it is a downloadable product, you need to add the following to your layout XML:

<remove name="product.info.downloadable"/>
0

It is simple. Just add this code in your catalog_product_view.xml inside body tag. Your stock availability will remove from product details page.

<referenceBlock name="product.info.simple.extra.catalog_inventory_stockqty_default" remove="true"/>

Thanks.

0

We can disabled it from admin Store -> Configuration, under Inventory section at 'Display Products Availability in Stock on Storefront' set no.

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.