2

What I want to override:

vendor/magento/module-catalog/view/frontend/layout/catalog_product_view.xml 

I copied the file to this location:

app/design/frontend/[Vendor]/[MyCustomTheme]/Magento_Catalog/layout/override/base/catalog_product_view.xml

I commented out the product.info.details block:

<!--block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="Magento_Catalog::product/view/details.phtml" after="product.info.media">
            <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" template="Magento_Catalog::product/view/attribute.phtml" group="detailed_info">
                <arguments>
                    <argument name="at_call" xsi:type="string">getDescription</argument>
                    <argument name="at_code" xsi:type="string">description</argument>
                    <argument name="css_class" xsi:type="string">description</argument>
                    <argument name="at_label" xsi:type="string">none</argument>
                    <argument name="title" translate="true" xsi:type="string">Details</argument>
                </arguments>
            </block>
            <block class="Magento\Catalog\Block\Product\View\Attributes" name="product.attributes" as="additional" template="Magento_Catalog::product/view/attributes.phtml" group="detailed_info">
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">More Information</argument>
                </arguments>
            </block>
        </block -->

I still see the block on my products page. I believe I followed every direction found here (using magento 2.2.4): https://devdocs.magento.com/guides/v2.2/frontend-dev-guide/layouts/layout-override.html

I then performed these cli operations:

php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:clean
php bin/magento cache:flush

Why am I not seeing any changes?

2
  • Did you get your answer ! Jun 14, 2018 at 5:24
  • No, I did not. I was using a Pearl theme from Weltpixel and it appears that was why I was not able to extend or override files according to the guides. I'm new to stackexchange, what should I do to close out a question like this?
    – user68323
    Jun 19, 2018 at 19:31

1 Answer 1

3

This is the correct path for it:

app/design/frontend/[Vendor]/[MyCustomTheme]/Magento_Catalog/layout/catalog_product_view.xml

Add this code on the catalog_product_view.xml if you want to remove the product info details

<referenceBlock name="product.info.details" remove="true">
2
  • 1
    Thanks Jake for the answer, is your answer considered extending rather than overriding? I have tried your method. It did not work for me so I installed a fresh copy of magento 2, extended the luma theme and added the Magento_Catalog/layout/catalog_product_view.xml layout file. I used the referenceBlock in your example to remove product.info.description, product.info.sku and product.info.overview. Nothing changed on my product page. The description, sku, and description overview blocks are still on the page.
    – user68323
    Jun 14, 2018 at 4:25
  • Yes, I believe this is a form of extending and not overriding. The overriding documentation is here and it does not seem to be working. Sep 8, 2020 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.