Skip to content

Commit

Permalink
Allow set billing information via API with existing address
Browse files Browse the repository at this point in the history
Not setting the customerId with an existing address caused a
`NoSuchEntityException` to be thrown during address validation https://github.com/magento/magento2/blob/56af1e73ce21867b770a7458ab6e109f4a1eface/app/code/Magento/Quote/Model/QuoteAddressValidator.php#L84

Fixes #17485
  • Loading branch information
pmclain committed Oct 19, 2018
1 parent f710f9b commit 7584f71
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions app/code/Magento/Quote/Model/BillingAddressManagement.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ public function assign($cartId, \Magento\Quote\Api\Data\AddressInterface $addres
{
/** @var \Magento\Quote\Model\Quote $quote */
$quote = $this->quoteRepository->getActive($cartId);
$address->setCustomerId($quote->getCustomerId());
$quote->removeAddress($quote->getBillingAddress()->getId());
$quote->setBillingAddress($address);
try {
Expand Down

0 comments on commit 7584f71

Please sign in to comment.