Skip to content

Commit a2d7fa0

Browse files
mstrzyzewskicieslix
authored andcommitted
Create an order as a guest
1 parent 525b742 commit a2d7fa0

File tree

2 files changed

+4
-72
lines changed

2 files changed

+4
-72
lines changed

Model/OrderImporter/Creator.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ class Creator
5858
/** @var StoreManagerInterface */
5959
private $storeManager;
6060

61-
/** @var Customer */
62-
private $customer;
63-
6461
/** @var ScopeConfigInterface */
6562
private $scopeConfig;
6663

@@ -85,7 +82,6 @@ class Creator
8582
* @param CartExtensionFactory $cartExtensionFactory
8683
* @param ProductRepositoryInterface $productRepository
8784
* @param StoreManagerInterface $storeManager
88-
* @param Customer $customer
8985
* @param ScopeConfigInterface $scopeConfig
9086
* @param QuoteManagement $quoteManagement
9187
* @param Registry $registry
@@ -101,7 +97,6 @@ public function __construct(
10197
CartExtensionFactory $cartExtensionFactory,
10298
ProductRepositoryInterface $productRepository,
10399
StoreManagerInterface $storeManager,
104-
Customer $customer,
105100
ScopeConfigInterface $scopeConfig,
106101
QuoteManagement $quoteManagement,
107102
Registry $registry
@@ -116,7 +111,6 @@ public function __construct(
116111
$this->cartExtensionFactory = $cartExtensionFactory;
117112
$this->productRepository = $productRepository;
118113
$this->storeManager = $storeManager;
119-
$this->customer = $customer;
120114
$this->scopeConfig = $scopeConfig;
121115
$this->quoteManagement = $quoteManagement;
122116
$this->registry = $registry;
@@ -177,8 +171,6 @@ public function execute(CheckoutFormInterface $checkoutForm)
177171
/**
178172
* @param Quote $quote
179173
* @param CheckoutFormInterface $checkoutForm
180-
* @throws NoSuchEntityException
181-
* @throws LocalizedException
182174
*/
183175
private function processCustomer(Quote $quote, CheckoutFormInterface $checkoutForm)
184176
{
@@ -193,12 +185,10 @@ private function processCustomer(Quote $quote, CheckoutFormInterface $checkoutFo
193185
);
194186
}
195187

196-
$customer = $this->customer->get(
197-
$checkoutForm->getBuyer(),
198-
$store = $this->getStore(),
199-
$checkoutForm->getInvoice()->getAddress()->getCompany()->getVatId()
200-
);
201-
$quote->assignCustomer($customer);
188+
$quote->setCustomerFirstname($checkoutForm->getBuyer()->getFirstName());
189+
$quote->setCustomerLastname($checkoutForm->getBuyer()->getLastName());
190+
$quote->setCustomerEmail($checkoutForm->getBuyer()->getEmail());
191+
$quote->setCustomerIsGuest(true);
202192
}
203193

204194
/**

Model/OrderImporter/Customer.php

Lines changed: 0 additions & 58 deletions
This file was deleted.

0 commit comments

Comments
 (0)