How to add custom text after product image in product list & grid view page via a custom module?
I want to add custom text before the product name, like shown in the picture.
1 Answer 1
- You have to override below xml code in your module.
app\code\Vendor\Extension\view\frontend\layout\catalog_category_view.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="category.products.list" template="Vendor_Extension::product/list.phtml" />
</body>
</page>
- Now copy the original file :
vendor\magento\module-catalog\view\frontend\templates\product\list.phtml
to
app\code\Vendor\Extension\view\frontend\templates\product\list.phtml
Now you can make the changes whatever you want into this overide file.
-
Thanks for the answer but I have already to this way but it's not working.Savan Dholu– Savan Dholu2021年12月17日 12:50:27 +00:00Commented Dec 17, 2021 at 12:50
-
Kindly check that, same file is not overide into another extension of theme. after doing the code run upgrade, deploy commands.Dhiren Vasoya– Dhiren Vasoya2021年12月17日 12:51:18 +00:00Commented Dec 17, 2021 at 12:51
-
I have do the same as per your answer & comment but it's not working.Savan Dholu– Savan Dholu2021年12月17日 13:04:10 +00:00Commented Dec 17, 2021 at 13:04
-
First confirm your module is register and enable into system.Dhiren Vasoya– Dhiren Vasoya2021年12月17日 13:05:05 +00:00Commented Dec 17, 2021 at 13:05
-
I have done everything but it's not working. I don't know why.Savan Dholu– Savan Dholu2021年12月17日 13:12:16 +00:00Commented Dec 17, 2021 at 13:12
Explore related questions
See similar questions with these tags.