Skip to content

Commit 8b51315

Browse files
committed
magento/graphql-ce#890: [Checkout] Replace usage of CartItemQuantity with CartItemInterface
1 parent c9c13a6 commit 8b51315

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,13 @@ public function execute(QuoteAddress $address): array
6868
} else {
6969
$itemId = $addressItem->getQuoteItemId();
7070
}
71-
71+
$productData = $addressItem->getProduct()->getData();
72+
$productData['model'] = $addressItem->getProduct();
7273
$addressItemsData[] = [
73-
'cart_item_id' => $itemId,
74-
'quantity' => $addressItem->getQty()
74+
'id' => $itemId,
75+
'quantity' => $addressItem->getQty(),
76+
'product' => $productData,
77+
'model' => $addressItem,
7578
];
7679
}
7780
$addressData['cart_items'] = $addressItemsData;

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,11 @@ private function getQuery(string $maskedQuoteId): string
137137
cart (cart_id: "{$maskedQuoteId}") {
138138
shipping_addresses {
139139
cart_items {
140-
cart_item_id
140+
id
141141
quantity
142+
product {
143+
sku
144+
}
142145
}
143146
available_shipping_methods {
144147
amount {

0 commit comments

Comments
 (0)