Skip to content

Commit b454951

Browse files
committed
ACP2E-3255: [GRAPHQL] model value should be specified when getting customerCart
- Fixed the CR comments.
1 parent 96d94ac commit b454951

File tree

4 files changed

+6
-189
lines changed

4 files changed

+6
-189
lines changed

app/code/Magento/Quote/Model/CreateEmptyCartForCustomer.php

-80
This file was deleted.

app/code/Magento/Quote/Model/QuoteManagement.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,9 @@ protected function _prepareCustomerQuote($quote)
696696
}
697697
//save here new customer address
698698
$shippingAddress->setCustomerId($quote->getCustomerId());
699-
$this->addressRepository->save($shippingAddress);
699+
if (!$shippingAddress->getId()) {
700+
$this->addressRepository->save($shippingAddress);
701+
}
700702
$quote->addCustomerAddress($shippingAddress);
701703
$shipping->setCustomerAddressData($shippingAddress);
702704
$this->addressesToSync[] = $shippingAddress->getId();
@@ -728,7 +730,9 @@ protected function _prepareCustomerQuote($quote)
728730
$billingAddress->setIsDefaultBilling(true);
729731
}
730732
$billingAddress->setCustomerId($quote->getCustomerId());
731-
$this->addressRepository->save($billingAddress);
733+
if (!$billingAddress->getId()) {
734+
$this->addressRepository->save($billingAddress);
735+
}
732736
$quote->addCustomerAddress($billingAddress);
733737
$billing->setCustomerAddressData($billingAddress);
734738
$this->addressesToSync[] = $billingAddress->getId();

app/code/Magento/QuoteGraphQl/Plugin/Model/Cart/CustomerEmptyCartResolver.php

-103
This file was deleted.

app/code/Magento/QuoteGraphQl/etc/graphql/di.xml

-4
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,4 @@
7979
<plugin name="merge_guest_orders_with_customer_after_place"
8080
type="Magento\QuoteGraphQl\Plugin\Model\MergeGuestOrder" />
8181
</type>
82-
<type name="Magento\Quote\Model\Cart\CustomerCartResolver">
83-
<plugin name="create_customer_cart"
84-
type="Magento\QuoteGraphQl\Plugin\Model\Cart\CustomerEmptyCartResolver" />
85-
</type>
8682
</config>

0 commit comments

Comments
 (0)