Magento – How to customize product list page in Magento 2

categorylist-viewmagento2productproduct-list

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.

Best Answer

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.

Related Topic