I am new in Magento 2. I want to add new custom text on listing page. I've attached a screenshot for reference.I have copy list.phtml from
/vendor/magento/module-catalog/view/frontend/templates/product/list.phtml
to dafault LUMA theme
app/design/frontend/Magento/Luma/Magento_Catalog/templates/product/list.phtml
I have added text in list.phtml of theme location file.my problem is that changes is not showing list page. but when i have same text changed in core list.phtml file changes is showing.
After Following commands run
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy
php bin/magento cache:flush
php bin/magento cache:clean
Best Answer
If you using magento default luma theme that you cannot use Template changes logic -
for luma theme bcoz of this theme is register under vendor/ folder.
In this create case, you should edit at core or need to create custom module from where you can template via layout
This module should consist of below files:
app/code/app/code/{vendorname}/{Modulename}/registration.php
app/code/{vendorname}/{Modulename}/composer.json
app/code/{vendorname}/{Modulename}/etc/module.xml
app/code/{vendorname}/view/frontend/layout/catalog_category_view.xml
app/code/{vendorname}/view/frontend/templates/product/list.phtml
catalog_category_view.xml code should be:
And
app/design/frontend/Magento/Luma/Magento_Catalog/templates/product/list.phtml
need to copy atapp/code/{vendorname}/view/frontend/templates/product/list.phtml