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?

  • Is your theme active? – Raj Mohan R Jul 23 at 10:21
  • Yes, theme is active. – Shoaib Saleem Jul 23 at 10:38
  • 1
    check any custom module use this file ? – Rk Rathod Jul 23 at 11:17
  • @RkRathod. Yes I found this file in a module, which uses default vendor file, not my theme file. – Shoaib Saleem Jul 23 at 12:21
  • Module name is WeltPixel GoogleTag Manager. – Shoaib Saleem Jul 23 at 12:22
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.

  • Directory structure is same as you mention above.I already said that every thing is working perfect from few days ago. – Shoaib Saleem Jul 23 at 6:53
  • please look closely, your second path is not correct if you're implementing in theme – Mohit Rane Jul 23 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, privacy policy and cookie policy

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