0

I Installed Third party module under app/code folder. I created another module under same app/code directory to override the third party module. I specified

<preference for="[Third party Name Space]\Block\File" type="[Name Space]\[My Module]\Block\File" />

in di.xml but still I cannot override the Block file of third party module.

  • What's the issue you are facing? – Rakesh Jesadiya Oct 6 '18 at 17:17
  • I cant able to override third party module's block file. I followed this answer too magento.stackexchange.com/a/210100/63813 – Prabhu M. Oct 6 '18 at 17:19
  • I created custom module and enabled to override that third party module and I specified <preference for="[Third party Name Space]\Block\File" type="[Name Space][My Module]\Block\File" /> in di.xml, but still the block file is rendering from third party module instead of from my custom module. – Prabhu M. Oct 6 '18 at 17:26
0

Overriding also depends upon the module sequence. So you can check in app/etc/config.php if your module is after than the 3rd party module or not. And if not then you can add the sequence in your etc/module.xml to load your module after the 3rd party module. For getting the detail overview of overriding you can check this link https://devdocs.magento.com/guides/v2.2/extension-dev-guide/build/module-load-order.html

  • Of course, I added the sequence to depend third party module in my custom module's module.xml, but still the block file is rendering from third party module. – Prabhu M. Oct 7 '18 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.