I would like to Override Magento\Catalog\Block\Product\View\Description, but I've got:

[2017-08-21 16:03:47] main.CRITICAL: Invalid template file: 'product/view/attribute.phtml' in module: 'Test_Catalog' block's name: 'product.info.sku' [] []

and detail.phtml is missing on frontend on product page.

I have done:


<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <preference for="Magento\Catalog\Block\Product\View\Description" type="Test\Catalog\Block\Product\View\Description" />

in Test/Catalog/Block/Product/View/Description:

namespace Test\Catalog\Block\Product\View;

class Description extends \Magento\Catalog\Block\Product\View\Description

     * @return array|bool
    public function getConfigProductChild()
         //function returns child products in array

I'm using TemplateMonster Theme so I would like to use getConfigProductChild function in :


I read that I should type referenceBlock with template and Mine block but it doest works (or I did something wrong?). Tried something like that:

in view/frontend/layout/default.xml of mine module:

 <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceBlock name="product.info.details" class="Test\Catalog\Block\Product\View\Description" template="Magento_Catalog::product/view/details.phtml" after="product.info.media"/>

Instead of Magento_Catalog I tried also use TemplateMonser etc.

Do You know what's the problem?


path for missing pthml:


layout using details.phtml:

        <referenceContainer name="content">
            <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.details" template="product/view/details.phtml" after="product.info.media">
                <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.description" template="product/view/attribute.phtml" group="detailed_info">
                        <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>
                <block class="Magento\Catalog\Block\Product\View\Attributes" name="product.attributes" as="additional" template="product/view/attributes.phtml" group="detailed_info">
                        <argument translate="true" name="title" xsi:type="string">More Information</argument>

In your current theme, you need to make change in catalog_product_view.xml file as below.

If your new template still exist in Magento_Catalog module then update code like below:

<block class="Test\Catalog\Block\Product\View\Description" name="product.info.details" template="Magento_Catalog::product/view/details.phtml" after="product.info.media" remove ="true"/>

If your new template still exist in Test_Catalog module then update code like below:

<block class="Test\Catalog\Block\Product\View\Description" name="product.info.details" template="Test_Catalog::product/view/details.phtml" after="product.info.media" remove ="true"/>
| improve this answer | |
  • Thanks for answer and your time! template exist in: /app/design/frontend/TemplateMonster/framework/Magento_Catalog/templates/product/view/details.phtml. In this case I should use Magento_Catalog, right? It doesnt works. – Konrad Siamro Aug 22 '17 at 5:52
  • Magento_Catalog yes it is correct. Can you please share how you are using in layout and pls check log also – Pankaj Pareek Aug 22 '17 at 6:53
  • I just edit my post – Konrad Siamro Aug 22 '17 at 7:07
  • framework is the only theme in TemplateMonster package ? Also in your updated layout code - you have not change path Magento_Catal‌​og:: this one is missing – Pankaj Pareek Aug 22 '17 at 7:11
  • 1
    Yes, I had to add Magento_Catal‌​og:: to TemplateMonster layout also. Thanks! – Konrad Siamro Aug 23 '17 at 6:41

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.