Skip to content

Commit bed82ff

Browse files
committed
MAGETWO-62044: Not possible to update or delete products in cart or checkout after deleting address
1 parent b6bf1d2 commit bed82ff

File tree

4 files changed

+2
-4
lines changed

4 files changed

+2
-4
lines changed

app/code/Magento/Quote/Api/Data/AddressInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public function getCustomerAddressId();
370370
/**
371371
* Set customer address id
372372
*
373-
* @param int $customerAddressId
373+
* @param int|null $customerAddressId
374374
* @return $this
375375
*/
376376
public function setCustomerAddressId($customerAddressId);

app/code/Magento/Quote/Model/Quote/ShippingAssignment/ShippingAssignmentProcessor.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ public function save(CartInterface $quote, ShippingAssignmentInterface $shipping
9999
try {
100100
$this->addressRepository->getById($shippingAddress->getCustomerAddressId());
101101
} catch (NoSuchEntityException $e) {
102-
$shippingAddress->setCustomerAddressId(null);
103102
$shippingAssignment->getShipping()->getAddress()->setCustomerAddressId(null);
104103
}
105104
}

app/code/Magento/Quote/Test/Unit/Model/Quote/ShippingAssignment/ShippingAssignmentProcessorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function testSaveWithNotExistingCustomerAddress()
155155
->method('getById')
156156
->with($customerAddressId)
157157
->willThrowException(new NoSuchEntityException());
158-
$this->shippingAddressMock->expects(static::exactly(2))
158+
$this->shippingAddressMock->expects(static::once())
159159
->method('setCustomerAddressId')
160160
->with(null)
161161
->willReturn($this->shippingAddressMock);

dev/tests/integration/testsuite/Magento/Quote/Model/QuoteRepositoryTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ public function testSaveWithNotExistingCustomerAddress()
117117
$this->quoteRepository->save($quote);
118118

119119
$this->assertNull($quote->getBillingAddress()->getCustomerAddressId());
120-
$this->assertNull($quote->getShippingAddress()->getCustomerAddressId());
121120
$this->assertNull(
122121
$quote->getExtensionAttributes()
123122
->getShippingAssignments()[0]

0 commit comments

Comments
 (0)