Skip to content

Problem with Overriding 3rd party module phtml template

I need to override the third party module template file
app/code/Codazon/Shopbybrandpro/view/frontend/templates/brand/brand_search.phtml

Relevant Block from Original

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="content">
            <block class="CodazonShopbybrandproBlockBrandAllBrands" name="all_brands" template="Codazon_Shopbybrandpro::brand/all_brands.phtml">
                <block class="CodazonShopbybrandproBlockWidgetBrandSearch" name="brand_search" template="Codazon_Shopbybrandpro::brand/brand_search.phtml" />
                <block class="CodazonShopbybrandproBlockWidgetBrandSlider" name="featured_brands" template="Codazon_Shopbybrandpro::brand/featured_brands.phtml" />
                <block class="CodazonShopbybrandproBlockBrandAllBrands" name="brand_alphabet_list" template="Codazon_Shopbybrandpro::brand/list-container.phtml">
                    <block class="CodazonShopbybrandproBlockBrandBrandList" name="brand_list" template="Codazon_Shopbybrandpro::brand/list.phtml">
                        <block class="CodazonShopbybrandproBlockBrandBrandListToolbar" name="brand_list_toolbar" template="Codazon_Shopbybrandpro::brand/list/toolbar.phtml">
                            <block class="MagentoThemeBlockHtmlPager" name="brand_list_toolbar_pager"/>
                        </block>
                        <action method="setToolbarBlockName">
                            <argument name="name" xsi:type="string">brand_list_toolbar</argument>
                        </action>
                    </block>
                </block>
            </block>
        </referenceContainer>
    </body>
</page>

Please see the 2nd block brand_search

I tried to override brand/brand_search.phtml like in the following.

In my module, view/frontend/layout/default.xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="brand_search" template="Iwdat_UiCustom9::brand_search.phtml"/>            
</body>
</page>

And I have a modified copy of original phtml file view/frontend/templates/brand_search.phtml

Even after compiling,removal of cache and static content still the modifications are not reflected in froned.

Have I done any syntactical error or other could this be another issue.

Thanks and Best Regards

Indunil