2

I've a malfunctioning module that needs to be overwritten in some parts. I would like to create a custom module that fixes that module instead of making changes in a theme as suggested in magento docs. The problem is that I'd rather keep my fixing module next to bad one so I can easily reuse it in another projects.

Another way is to remove malfunctioning phtml by layout.xml in a custom (fixing) module and replace that file with one of my own.

Which way is better and should be performed in cases like mine?

2 Answers 2

2

Simplest way to override phtml template using Custom module. just add sequence into module.xml and then override your layout with template.

That set.

And if you want to override it using theme then just copy layout xml file & set your template path to that file with block and append in it.

3
  • Could you post that sequence for module.xml? I don't know which sequence you're talking about
    – Luke
    Commented Nov 4, 2016 at 11:14
  • which module you want to override? Commented Nov 4, 2016 at 12:53
  • can you please explain your second method. Commented Jun 28, 2019 at 14:51
2

here is my module.xml :

<?xml version="1.0"?>
 <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
  <module name="vendor_custommodule" setup_version="1.0.0">
    <sequence>
        <module name="Magento_Catalog"/>
        <module name="Magento_Cms"/>
        <module name="Magento_Sales"/>
    </sequence> 
  </module>
</config>

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.