Skip to content

Commit

Permalink
fix code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Nazar65 committed Nov 13, 2018
1 parent ccba420 commit f8a6d05
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions app/code/Magento/Quote/Model/QuoteManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class QuoteManagement implements \Magento\Quote\Api\CartManagementInterface
* @param \Magento\Quote\Api\CartRepositoryInterface $quoteRepository
* @param \Magento\Customer\Api\CustomerRepositoryInterface $customerRepository
* @param \Magento\Customer\Model\CustomerFactory $customerModelFactory
* @param \Magento\Quote\Model\Quote\AddressFactory $quoteAddressFactory,
* @param \Magento\Quote\Model\Quote\AddressFactory $quoteAddressFactory
* @param \Magento\Framework\Api\DataObjectHelper $dataObjectHelper
* @param StoreManagerInterface $storeManager
* @param \Magento\Checkout\Model\Session $checkoutSession
Expand Down Expand Up @@ -221,7 +221,7 @@ public function __construct(
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function createEmptyCart()
{
Expand All @@ -241,7 +241,7 @@ public function createEmptyCart()
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function createEmptyCartForCustomer($customerId)
{
Expand All @@ -257,7 +257,7 @@ public function createEmptyCartForCustomer($customerId)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function assignCustomer($cartId, $customerId, $storeId)
{
Expand Down Expand Up @@ -332,7 +332,7 @@ protected function createCustomerCart($customerId, $storeId)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function placeOrder($cartId, PaymentInterface $paymentMethod = null)
{
Expand All @@ -354,11 +354,12 @@ public function placeOrder($cartId, PaymentInterface $paymentMethod = null)
if ($quote->getCheckoutMethod() === self::METHOD_GUEST) {
$quote->setCustomerId(null);
$quote->setCustomerEmail($quote->getBillingAddress()->getEmail());
$quote->setCustomerFirstname($quote->getBillingAddress()->getFirstname());
$quote->setCustomerLastname($quote->getBillingAddress()->getLastname());

if ($quote->getBillingAddress()->getMiddlename()) {
$quote->setCustomerMiddlename($quote->getBillingAddress()->getMiddlename());
if ($quote->getCustomerFirstname() === null && $quote->getCustomerLastname() === null) {
$quote->setCustomerFirstname($quote->getBillingAddress()->getFirstname());
$quote->setCustomerLastname($quote->getBillingAddress()->getLastname());
if ($quote->getBillingAddress()->getMiddlename() === null) {

This comment has been minimized.

Copy link
@jasperzeinstra

jasperzeinstra Feb 10, 2021

Contributor

@Nazar65 FYI, you removed middle name from guest orders because you added === null. I'm going to write a PR to fix this and to also add Prefix and Suffix.

$quote->setCustomerMiddlename($quote->getBillingAddress()->getMiddlename());
}
}
$quote->setCustomerIsGuest(true);
$quote->setCustomerGroupId(\Magento\Customer\Api\Data\GroupInterface::NOT_LOGGED_IN_ID);
Expand All @@ -385,7 +386,7 @@ public function placeOrder($cartId, PaymentInterface $paymentMethod = null)
}

/**
* {@inheritdoc}
* @inheritdoc
*/
public function getCartForCustomer($customerId)
{
Expand All @@ -412,6 +413,8 @@ public function submit(QuoteEntity $quote, $orderData = [])
}

/**
* Resolve items
*
* @param Quote $quote
* @return array
*/
Expand Down

0 comments on commit f8a6d05

Please sign in to comment.