1

I am working on Magento 2 and I override few PHTML files from

vendor/magento/module-catalog/view/frontend/templates/product/list/items.phtml

to

app/design/frontend/vendor/module/Magento_Catalog/templates/product/list/items.phtml

From few days my app/design > items.phtml not working, showing vendor items.phtml layout. Working fine before.

I also run all these commands.

php magento setup:upgrade  
php magento setup:di:compile  
php magento setup:static-content:deploy -f

php magento indexer:reindex  
php magento cache:flush

Please help?

6
  • Is your theme active? Jul 23, 2019 at 10:21
  • Yes, theme is active. Jul 23, 2019 at 10:38
  • 1
    check any custom module use this file ? Jul 23, 2019 at 11:17
  • @RkRathod. Yes I found this file in a module, which uses default vendor file, not my theme file. Jul 23, 2019 at 12:21
  • Module name is WeltPixel GoogleTag Manager. Jul 23, 2019 at 12:22

3 Answers 3

1

Below will work fine:

YourThemesVendor = your theme vendorname e.g. Mine is "pearl"

YourThemeNamespace = your theme themename e.g. Mine is "customize"

app/design/frontend/YourThemesVendor/YourThemeNamespace/Magento_Catalog /templates/product/list/items.phtml

0

In Your Theme

If you want to override in your theme then create a following directory structure

app/design/frontend/Vendor/Mytheme/Magento_Catalog/templates/product/list

Copy items.phtml file from below path

vendor/magento/module-catalog/view/frontend/templates/product/list/items.phtml

You can also override Layout file catalog_product_view.xml from vendor/magento/module-catalog/view/frontend/layout to your theme and make the changes you wish.

app/design/frontend/Vendor/Mytheme/Magento_Catalog/layout

<block class="Magento\Catalog\Block\Product\ProductList\Related" name="catalog.product.related" template="Magento_Catalog::product/list/items.phtml">

In your Module

If you want to override in your Module then create a following directory structure

app/code/Vendor/Module/view/frontend/templates/product/list

Copy items.phtml file from below path

vendor/magento/module-catalog/view/frontend/templates/product/list/items.phtml

Override Layout file catalog_product_view.xml from vendor/magento/module-catalog/view/frontend/layout to your module and make the changes you wish.

app/code/Vendor/Module/view/frontend/layout

Remove Cache

php bin/magento cache:clean
php bin/magento cache:flush

Hope it Helps.

2
  • Directory structure is same as you mention above.I already said that every thing is working perfect from few days ago. Jul 23, 2019 at 6:53
  • please look closely, your second path is not correct if you're implementing in theme
    – Mohit Rane
    Jul 23, 2019 at 6:55
0

Thanks @RkRathod to pointing me. I have found solution of my answer.Actually I am using Google Tag Manager extension which is using this template. So this module was override my items file.I just replaced with my theme items file and issue resolved.

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.