File tree Expand file tree Collapse file tree 2 files changed +33
-23
lines changed
app/code/Magento/QuoteGraphQl/Model/Cart
dev/tests/api-functional/testsuite/Magento/GraphQl/Quote/Guest Expand file tree Collapse file tree 2 files changed +33
-23
lines changed Original file line number Diff line number Diff line change @@ -61,8 +61,14 @@ public function execute(QuoteAddress $address): array
61
61
62
62
$ addressItemsData = [];
63
63
foreach ($ address ->getAllItems () as $ addressItem ) {
64
+ if ($ addressItem instanceof \Magento \Quote \Model \Quote \Item) {
65
+ $ itemId = $ addressItem ->getItemId ();
66
+ } else {
67
+ $ itemId = $ addressItem ->getQuoteItemId ();
68
+ }
69
+
64
70
$ addressItemsData [] = [
65
- 'cart_item_id ' => $ addressItem -> getQuoteItemId () ,
71
+ 'cart_item_id ' => $ itemId ,
66
72
'quantity ' => $ addressItem ->getQty ()
67
73
];
68
74
}
Original file line number Diff line number Diff line change @@ -139,29 +139,33 @@ private function getQuery(string $maskedQuoteId): string
139
139
query {
140
140
cart (cart_id: " {$ maskedQuoteId }") {
141
141
shipping_addresses {
142
- available_shipping_methods {
143
- amount {
144
- value
145
- currency
146
- }
147
- base_amount {
148
- value
149
- currency
150
- }
151
- carrier_code
152
- carrier_title
153
- error_message
154
- method_code
155
- method_title
156
- price_excl_tax {
157
- value
158
- currency
159
- }
160
- price_incl_tax {
161
- value
162
- currency
163
- }
142
+ cart_items {
143
+ cart_item_id
144
+ quantity
145
+ }
146
+ available_shipping_methods {
147
+ amount {
148
+ value
149
+ currency
164
150
}
151
+ base_amount {
152
+ value
153
+ currency
154
+ }
155
+ carrier_code
156
+ carrier_title
157
+ error_message
158
+ method_code
159
+ method_title
160
+ price_excl_tax {
161
+ value
162
+ currency
163
+ }
164
+ price_incl_tax {
165
+ value
166
+ currency
167
+ }
168
+ }
165
169
}
166
170
}
167
171
}
You can’t perform that action at this time.
0 commit comments