I'm working on a Magento 2.2.3 B2B, with the Quick Order feature enabled, and I can't find a way to extend a method of the Magento\QuickOrder\Model\Cart
model.
So far I tried the usual:
MyCompany/MyModule/etc/di.xml
:
<preference for="Magento\QuickOrder\Model\Cart"
type="MyCompany\MyModule\Model\Cart"/>
and then in MyCompany\MyModule\Model\Cart.php
:
<?php
namespace MyCompany\MyModule\Model;
class Cart extends \Magento\QuickOrder\Model\Cart
{
protected function _addAffectedItem($item, $code)
{
// My extended code
}
}
But it's not working. I also tried using a plugin, but for some reason my code is being ignored. Any ideas of what's going on with this Model?
Thanks in advance