I am using Magento 2.1.7 CE
sometimes when Im trying modify cart (remove product, add, or update qty) I got Error:
"Invalid customer address id XX"
.
I noticed that in class Magento\Framework\Exception\NoSuchEntityException\QuoteAddressValidator
there is function validate
with $applicableAddressIds
variable.
There should be array with all Customer's addresses:
$applicableAddressIds = array_map(function ($address) {
/** @var \Magento\Customer\Api\Data\AddressInterface $address */
return $address->getId();
}, $this->customerRepository->getById($addressData->getCustomerId())->getAddresses());
Unfortunately getAddresses()
is empty (yes, I checked it).
Customer is not empty.
Someone knows what happens?