で定義されたテンプレートをカスタムモジュールに上書きしようとしています。ファイルには、そのように定義されたproduct.info.grouped
という名前のブロックがあります。だから私は、ファイル/app/code/FortyThree/GroupedConfigurableProduct/view/frontend/layout/catalog_product_view_type_grouped.xml
を作成し、それMagento 2のカスタムモジュールでテンプレートを上書きする
<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/layout_generic.xsd">
<referenceBlock name="product.info.grouped">
<action method="setTemplate">
<argument name="template" xsi:type="string">FortyThree_GroupedConfigurableProduct::product/view/type/grouped.phtml</argument>
</action>
</referenceBlock>
</layout>
で、対応する.phtmlファイルを作成したが、それは元のテンプレートを上書きしません
<block class="Magento\GroupedProduct\Block\Product\View\Type\Grouped" name="product.info.grouped" before="product.info.addtocart" template="product/view/type/grouped.phtml"/>
ファイル。上書きを登録するために何か必要なことはありますか?私は
setup:upgrade
を試して、キャッシュされた何も動作しないように見える。私は
Magento_GroupedProduct
を私の
module.xml
の配列セクションにセットして、そのロードを確実にしています。
実際には、catalog_product_view_type_grouped.xml
が読まれているようではありません。私はそこに何もしていないので問題はないようです。