Skip to content

Commit 35e98f5

Browse files
committed
graphQl-509: save_in_address_book has no impact on Address Book
1 parent 359d1f3 commit 35e98f5

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

app/code/Magento/QuoteGraphQl/Model/Cart/Address/SaveQuoteAddressToCustomerAddressBook.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ public function __construct(
5252
}
5353

5454
/**
55-
*
5655
* @param QuoteAddress $quoteAddress
5756
* @param int $customerId
5857
*

app/code/Magento/QuoteGraphQl/Model/Cart/SetShippingAddressesOnCart.php

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,24 @@ public function execute(ContextInterface $context, CartInterface $cart, array $s
7878
);
7979
}
8080

81+
$shippingAddress = $this->createShippingAddress($context, $customerAddressId, $addressInput);
82+
83+
$this->assignShippingAddressToCart->execute($cart, $shippingAddress);
84+
}
85+
86+
/**
87+
* @param ContextInterface $context
88+
* @param int|null $customerAddressId
89+
* @param array|null $addressInput
90+
*
91+
* @return \Magento\Quote\Model\Quote\Address
92+
* @throws GraphQlAuthorizationException
93+
*/
94+
private function createShippingAddress(
95+
ContextInterface $context,
96+
?int $customerAddressId,
97+
?array $addressInput
98+
) {
8199
$customerId = $context->getUserId();
82100

83101
if (null === $customerAddressId) {
@@ -98,6 +116,6 @@ public function execute(ContextInterface $context, CartInterface $cart, array $s
98116
);
99117
}
100118

101-
$this->assignShippingAddressToCart->execute($cart, $shippingAddress);
119+
return $shippingAddress;
102120
}
103121
}

0 commit comments

Comments
 (0)