getRequest()->getParam('id'); if (!$quoteItemId) { throw new \Magento\Framework\Exception\LocalizedException( __('The quote item ID needs to be received. Set the ID and try again.') ); } $quoteItem = $this->_objectManager->create(\Magento\Quote\Model\Quote\Item::class)->load($quoteItemId); if (!$quoteItem->getId()) { throw new \Magento\Framework\Exception\LocalizedException( __('The quote item needs to be loaded. Load the item and try again.') ); } $configureResult->setOk(true); $optionCollection = $this->_objectManager->create(\Magento\Quote\Model\Quote\Item\Option::class) ->getCollection() ->addItemFilter([$quoteItemId]); $quoteItem->setOptions($optionCollection->getOptionsByItem($quoteItem)); $configureResult->setBuyRequest($quoteItem->getBuyRequest()); $configureResult->setCurrentStoreId($quoteItem->getStoreId()); $configureResult->setProductId($quoteItem->getProductId()); $sessionQuote = $this->_objectManager->get(\Magento\Backend\Model\Session\Quote::class); $configureResult->setCurrentCustomerId($sessionQuote->getCustomerId()); } catch (\Exception $e) { $configureResult->setError(true); $configureResult->setMessage($e->getMessage()); } // Render page /** @var \Magento\Catalog\Helper\Product\Composite $helper */ $helper = $this->_objectManager->get(\Magento\Catalog\Helper\Product\Composite::class); return $helper->renderConfigureResult($configureResult); } }