0

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.

enter image description here

Cladiuss
1,3011 gold badge15 silver badges29 bronze badges
asked Dec 17, 2021 at 12:38

1 Answer 1

2
  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>
  1. 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.

answered Dec 17, 2021 at 12:48
6
  • Thanks for the answer but I have already to this way but it's not working. Commented 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. Commented Dec 17, 2021 at 12:51
  • I have do the same as per your answer & comment but it's not working. Commented Dec 17, 2021 at 13:04
  • First confirm your module is register and enable into system. Commented Dec 17, 2021 at 13:05
  • I have done everything but it's not working. I don't know why. Commented Dec 17, 2021 at 13:12

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.