0

With this question I want to go further and to exactly know if it's possible to override:

vendor/magento/module-multishipping/Model/Checkout/Type/Multishipping.php

so far I've experienced some complications performing this override, I had to override also PlaceOrderDefaulr, PlaceOrderFactory and PlaceOrderInferface

I've added preferences tags in ../etc/di.xml of my module to include above mentioned classes, but now the error prompted is:

Fatal error: Uncaught TypeError: Argument 2 passed to Magento\Multishipping\Model\Checkout\Type\Multishipping\State::__construct() must be an instance of Magento\Multishipping\Model\Checkout\Type\Multishipping, instance of Vendor\MyModule\Model\Checkout\Type\Multishipping given, called in /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 111

I've cleared /generated folder and also /var/cache, view_preprocessed, page_cache, session/

and the error is still the same.. as a second parameter in constructor the follwing is called:

\Magento\Customer\Model\Session

Then used to retrieve logged-in customer information to get addresses, etc.

Any ideas? will be appreciated.

0

I've managed to solve the issue, simply creating an override for

Magento\Multishipping\Model\Checkout\Type\Multishipping\State

in my module and the consequents necessary overrides that were arise after fix that.. just like that.

I've created

Vendor\MyModule\Model\Checkout\Type\Multishipping\State

And updated namespace and construct to use my module instead the Magento2 one.

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.