114 \
Magento\Sales\Model\OrderFactory $orderFactory,
121 $this->_orderFactory = $orderFactory;
136 if ($this->_storeManager->hasSingleStore()) {
137 $this->setStoreId($this->_storeManager->getStore(
true)->getId());
148 if ($this->_quote ===
null) {
149 $this->_quote = $this->quoteFactory->create();
150 if ($this->getStoreId()) {
151 if (!$this->getQuoteId()) {
152 $this->_quote->setCustomerGroupId($this->groupManagement->getDefaultGroup()->getId());
153 $this->_quote->setIsActive(
false);
154 $this->_quote->setStoreId($this->getStoreId());
156 $this->quoteRepository->save($this->_quote);
157 $this->setQuoteId($this->_quote->getId());
158 $this->_quote = $this->quoteRepository->get($this->getQuoteId(), [$this->getStoreId()]);
160 $this->_quote = $this->quoteRepository->get($this->getQuoteId(), [$this->getStoreId()]);
161 $this->_quote->setStoreId($this->getStoreId());
164 if ($this->getCustomerId() && $this->getCustomerId() != $this->_quote->getCustomerId()) {
165 $customer = $this->customerRepository->getById($this->getCustomerId());
166 $this->_quote->assignCustomer(
$customer);
167 $this->quoteRepository->save($this->_quote);
170 $this->_quote->setIgnoreOldQty(
true);
171 $this->_quote->setIsSuperMode(
true);
184 if ($this->_store ===
null) {
185 $this->_store = $this->_storeManager->getStore($this->getStoreId());
186 $currencyId = $this->getCurrencyId();
188 $this->_store->setCurrentCurrencyCode($currencyId);
201 if ($this->_order ===
null) {
202 $this->_order = $this->_orderFactory->create();
203 if ($this->getOrderId()) {
204 $this->_order->load($this->getOrderId());
__construct(\Magento\Framework\App\Request\Http $request, \Magento\Framework\Session\SidResolverInterface $sidResolver, \Magento\Framework\Session\Config\ConfigInterface $sessionConfig, \Magento\Framework\Session\SaveHandlerInterface $saveHandler, \Magento\Framework\Session\ValidatorInterface $validator, \Magento\Framework\Session\StorageInterface $storage, \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager, \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory, \Magento\Framework\App\State $appState, CustomerRepositoryInterface $customerRepository, \Magento\Quote\Api\CartRepositoryInterface $quoteRepository, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, GroupManagementInterface $groupManagement, \Magento\Quote\Model\QuoteFactory $quoteFactory)