I want to override product list.phtml and in my layout file catalog_category_veiw.xml i tried many methods but still not able to call my templates file

<referenceBlock name="category.products.list"  >
                <argument name="template" xsi:type="string">Vendor_Module::product/list.phtml</argument>

I also tried this method

<referenceBlock name="category.products.list">
                    <action method="setTemplate">
                        <argument name="template" xsi:type="string">Vendor_Module::product/list.phtml</argument>

i also tried this

<referenceBlock name="category.products.list" template="Vendor_Modulename::product/list.phtml" />

I tried this all but not able to override, please help me to solve this and also tell me where i make mistakes, Thank you

  • you want to override or you want to change the block template?
    – Ronak
    Feb 28, 2020 at 13:17
  • i want to add some extra containt, calling Ajax
    – Arjun Soni
    Feb 28, 2020 at 13:19
  • then you just need to override in your theme like vendor/theme/Magento_Product/templates/product/list.phtml
    – Ronak
    Feb 28, 2020 at 13:21
  • I am using default theme
    – Arjun Soni
    Feb 28, 2020 at 13:22
  • then create custom module for that
    – Ronak
    Feb 28, 2020 at 13:24

1 Answer 1


To override in your module you can do something like this:

Create etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\Catalog\Block\Product\ListProduct">
        <plugin name="override_list_template" type="Vendor\Module\Plugin\Catalog\Block\Product\ListProduct" />

In Vendor\Module\Plugin\Catalog\Block\Product\ListProduct

namespace Vendor\Module\Plugin\Catalog\Block\Product\ListProduct;

class View
    public function beforeToHtml(\Magento\Catalog\Block\Product\ListProduct $subject)
        if ($template === 'Magento_Catalog::product/list.phtml') {

In view/frontend/templates/product/list.phtml put your override.

Note You should be able to just do this in your module:

<referenceBlock name="category.products.list" template="Vendor_Modulename::product/list.phtml" />

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.