i wrote a simple module to override this core Model class, but on frontend it shows this error message:
“Fatal error: Uncaught TypeError: Argument 3 passed to
MagentoQuoteModelQuoteShippingAssignmentShippingProcessor::__construct()
must be an instance of MagentoQuoteModelShippingMethodManagement,
instance of shippingmoduleModelShippingMethodManagementInterceptor
…..”
HERE IS MY ‘di.xml’ file content:
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="MagentoQuoteModelShippingMethodManagement" type="shippingmoduleModelShippingMethodManagement" />
</config>
4
Answers
You Need To Do :-
And Clean Cache
You need to run below commands after ensuring full permission:
If error still persist, check if you are in developer mode by this command:
set in developer mode :
after setting to developer mode, remove var and generated folder,
then flush cache :
Extend your class using the core path of the file as given below.
In **shippingmoduleModel**
Don’t forget to run the following commands after the change.
After added new Argument in constructor, need to re-created interpreter.So run di :compile command