productOptionFactory = $productOptionFactory; } /** * Replace cart item product options for disabled quote. * * @param SaveHandler $subject * @param CartInterface $quote * @return array * @see MAGETWO-70500 * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ public function beforeSave(SaveHandler $subject, CartInterface $quote) { if (!$quote->getIsActive()) { $items = $quote->getItems(); if ($items) { foreach ($items as $item) { /** @var \Magento\Quote\Model\Quote\Item $item */ if (!$item->isDeleted()) { $item->setProductOption($this->productOptionFactory->create()); } } } } return [$quote]; } }