Skip to content

Commit 20f85f1

Browse files
authored
ENGCOM-4381: Cart Shipping Address and Method Fixes #391
2 parents 8f098c4 + 2216f0e commit 20f85f1

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function execute(QuoteAddress $address): array
4141
$addressData['model'] = $address;
4242

4343
$addressData = array_merge($addressData, [
44+
'address_id' => $address->getId(),
4445
'country' => [
4546
'code' => $address->getCountryId(),
4647
'label' => $address->getCountry()

app/code/Magento/QuoteGraphQl/Model/Resolver/SetShippingMethodsOnCart.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
7272
if (!$shippingMethod['cart_address_id']) {
7373
throw new GraphQlInputException(__('Required parameter "cart_address_id" is missing'));
7474
}
75-
if (!$shippingMethod['shipping_carrier_code']) {
75+
if (!$shippingMethod['carrier_code']) {
7676
throw new GraphQlInputException(__('Required parameter "shipping_carrier_code" is missing'));
7777
}
78-
if (!$shippingMethod['shipping_method_code']) {
78+
if (!$shippingMethod['method_code']) {
7979
throw new GraphQlInputException(__('Required parameter "shipping_method_code" is missing'));
8080
}
8181

@@ -85,8 +85,8 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
8585
$this->setShippingMethodOnCart->execute(
8686
$cart,
8787
$shippingMethod['cart_address_id'],
88-
$shippingMethod['shipping_carrier_code'],
89-
$shippingMethod['shipping_method_code']
88+
$shippingMethod['carrier_code'],
89+
$shippingMethod['method_code']
9090
);
9191

9292
return [

app/code/Magento/QuoteGraphQl/etc/schema.graphqls

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ type Cart {
128128
}
129129

130130
type CartAddress {
131+
address_id: Int
131132
firstname: String
132133
lastname: String
133134
company: String

0 commit comments

Comments
 (0)