5

I am new to Magento and want to customize the product list page. I want to add some text on the product if that product is available in more options(already configured this in admin). Something like attached screenshot

https://i.imgur.com/yQnqfsy.jpg

I am sure I need to do something with catalog_category_view but not sure how to achieve this.

2 Answers 2

1

Copy the Product Listing file from Catalog Module from below mentioned path:

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

In your Theme Directory as per below mentioned path:

app/design/frontend/[Theme_Package]/[Theme_Name]/Magento_Catalog/templates/product/list.phtml

As you have already created attribute, make sure attribute option "Used in Product Listing" set as true. and In list.phtml, you can fetch attribute and display as per your requirement.

2
  • I am trying to add viewmodel n catalog_product_view.xml at app/design/frontend/[Theme_Package]/[Theme_Name]/Magento_Catalog/layout but getting error can you help me if m using the correct block <block class="\Magento\Catalog\Block\Product\Image" name="product.list" template="Magento_Catalog::product/list.phtml"> <arguments> <argument name="series_helper" xsi:type="object">Custom\Theme\ViewModel\Series</argument> </arguments> </block>
    – User9009
    Commented Jul 11, 2018 at 7:13
  • No never rewrite the block or class file if you are working on extension and also magento not recommending to overwrite any block or class file.
    – Himanshu
    Commented Dec 25, 2018 at 7:16
0

Not sure if I have followed your query, but seems that you want what is called Product Label. An easy way is to add an extension. Browse on Magento Marketplace and search for something you like.

some examples are: https://marketplace.magento.com/magebees-product-labels.html https://marketplace.magento.com/bsscommerce-product-label.html

They add the info and provide a nice professional look. Hope that solves your issue.

2
  • No I dnt want any product label. I have added products in group and on product page want to show icon if product is connected to any group
    – User9009
    Commented Jul 10, 2018 at 13:14
  • @User9009 This icon is called product label, no? Commented Aug 19, 2020 at 6:34

Your Answer

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

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