Skip to content

Commit 98d1258

Browse files
committed
MC-37484: Cart query error when trying to switch store view
1 parent 2a9fb0a commit 98d1258

File tree

5 files changed

+5
-1
lines changed

5 files changed

+5
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
8585
throw new LocalizedException(__($e->getMessage()), $e);
8686
}
8787

88+
$cart = $this->getCartForUser->execute($maskedCartId, $currentUserId, $storeId);
8889
return [
8990
'cart' => [
9091
'model' => $cart,

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
6969
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
7070
$this->checkCartCheckoutAllowance->execute($cart);
7171
$this->setBillingAddressOnCart->execute($context, $cart, $billingAddress);
72+
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
7273

7374
return [
7475
'cart' => [

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
6969
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
7070
$this->checkCartCheckoutAllowance->execute($cart);
7171
$this->setShippingMethodsOnCart->execute($context, $cart, $shippingMethods);
72+
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
7273

7374
return [
7475
'cart' => [

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
8383
throw new GraphQlInputException(__($e->getMessage()), $e);
8484
}
8585

86+
$cart = $this->getCartForUser->execute($maskedCartId, $context->getUserId(), $storeId);
8687
return [
8788
'cart' => [
8889
'model' => $cart,

dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest/UpdateCartItemsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public function testUpdateGiftMessageCartForItem()
316316
$query = $this->getUpdateGiftMessageQuery($messageTo, $messageFrom, $message);
317317
foreach ($this->graphQlMutation($query)['updateCartItems']['cart']['items'] as $item) {
318318
self::assertArrayHasKey('gift_message', $item);
319-
self::assertSame(null, $item['gift_message']);
319+
self::assertSame(['to' => '', 'from' => '', 'message' => ''], $item['gift_message']);
320320
}
321321
}
322322

0 commit comments

Comments
 (0)