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.

Teja Bhagavan Kollepara
3,8275 gold badges33 silver badges69 bronze badges
asked Oct 6, 2018 at 17:13
3
  • What's the issue you are facing? Commented Oct 6, 2018 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 Commented Oct 6, 2018 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. Commented Oct 6, 2018 at 17:26

1 Answer 1

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

1
  • 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. Commented Oct 7, 2018 at 11:44

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.