Skip to content

Commit

Permalink
Transform quote address country code to uppercase
Browse files Browse the repository at this point in the history
Fixes magento/graphql-ce#658

Magento countryIds are uppercase and storing country_id as lowercase in quote
address items can cause undesired behavior when the Directory module determines
if a region is allowed for a given country.

Specifically this check fails when fetching the region code for a quote
address:
https://github.com/magento/graphql-ce/blob/a2fc3b98bf52ff7741579d16042b9c6376ecebfc/app/code/Magento/Customer/Model/Address/AbstractAddress.php#L400
  • Loading branch information
pmclain committed Jun 15, 2019
1 parent def6657 commit 5e83ddf
Showing 1 changed file with 1 addition and 0 deletions.
Expand Up @@ -74,6 +74,7 @@ public function execute(ContextInterface $context, CartInterface $cart, array $s
}

if (null === $customerAddressId) {
$addressInput['country_code'] = strtoupper($addressInput['country_code']);
$shippingAddress = $this->quoteAddressFactory->createBasedOnInputData($addressInput);
} else {
$customer = $this->getCustomer->execute($context);
Expand Down

0 comments on commit 5e83ddf

Please sign in to comment.