Skip to content

Commit c92e70e

Browse files
committed
MC-20636: Order Details :: Order Details by Order Number
- modify data provider for broader scope and add model
1 parent 4926fa6 commit c92e70e

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

app/code/Magento/SalesGraphQl/Model/Resolver/OrderItem/DataProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,8 @@ private function fetch()
134134
'id' => base64_encode($orderItem->getItemId()),
135135
'associatedProduct' => $associatedProduct,
136136
'model' => $orderItem,
137+
'product_name' => $orderItem->getName(),
138+
'product_sku' => $orderItem->getSku(),
137139
'product_url_key' => $associatedProduct ? $associatedProduct->getUrlKey() : null,
138140
'product_type' => $orderItem->getProductType(),
139141
'product_sale_price' => [

app/code/Magento/SalesGraphQl/Model/Resolver/OrderItems.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function resolve(Field $field, $context, ResolveInfo $info, array $value
6060
$parentOrder = $value['model'];
6161
$orderItemIds = [];
6262
foreach ($parentOrder->getItems() as $item) {
63-
if ((!$item->getParentItemId())) {
63+
if (!$item->getParentItemId()) {
6464
$orderItemIds[] = (int)$item->getItemId();
6565
}
6666
$this->orderItemProvider->addOrderItemId((int)$item->getItemId());

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ type OrderItem implements OrderItemInterface {
8282
}
8383

8484
type BundleOrderItem implements OrderItemInterface {
85-
child_items: [OrderItemInterface] @doc(description: "A list of child products that are assigned to the bundle product")
85+
bundle_options: [SelectedBundleOptionItems] @doc(description: "A list of bundle options that are assigned to the bundle product")
86+
}
87+
88+
type SelectedBundleOptionItems {
89+
label: String!
90+
values: [OrderItem] @doc(description: "A list of products that represent the values of the parent option")
8691
}
8792

8893
type OrderItemOption @doc(description: "Represents order item options like selected or entered") {

0 commit comments

Comments
 (0)