Unable to locate block in the layout files
-
15-04-2021 - |
Question
I need to change some layouts on the product detail page.
So I tried to locate some blocks in the layout files.
Using the template path hints fo example I know about a block with the template catalog/product/view/customize.phtml
But searching the project with PHP Storm for the term customize.phtml
just returns cache files.
For example in the cache there's this line:
<block class="Magento\Catalog\Block\Product\View" name="customize.button" as="customize_button" template="Magento_Bundle::catalog/product/view/customize.phtml" after="product.info.price"/>
But i thought there had to be be a layout xml adding this block somewhere.
Just not able to find it using the PHP Storm Search.
Where is this being added to the layout?
Solution
It seems you will find the entry here:
vendor/magento/module-bundle/view/frontend/layout/catalog_product_view_type_bundle.xml
<referenceContainer name="product.info.main">
<block class="Magento\Catalog\Block\Product\View" name="customize.button" as="customize_button" template="Magento_Bundle::catalog/product/view/customize.phtml" after="product.info.price" />
</referenceContainer>
OTHER TIPS
There are 2 xml files where customize.phtml is involved:
vendor/magento/module-wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml
vendor/magento/module-bundle/view/frontend/layout/catalog_product_view_type_bundle.xml
maybe the vendor folder is outside your phpstorm project