I want to add custom code in gallery.phtml in the PDP section on my custom module.
I tried this=>
called default the block in catalog_product_view.xml
<referenceBlock name="product.info.media.image">
<action method="setTemplate">
<argument name="template" xsi:type="string">Ajith_Mymodule::product/view/gallery.phtml</argument>
</action>
</referenceBlock>
loaded gallery.phtml with and without default code, nothing works well for me.
Am I’m trying the correct method or did anybody give me the idea to do this?
2
Answers
This method is working properly
call this in our custom template
If we take a look:
We can see that this template will be added via Observer event. So, we need to disable this observer event in our module. And then, try to add our custom template.