Skip to content

Commit 3ed6359

Browse files
author
Prabhu Ram
committed
MC-20636: MyAccount :: Order Details :: Order Details by Order Number
- merged MC-20637, MC-32658-tax onto MC-20636
1 parent 8721abd commit 3ed6359

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Magento\Sales\Api\Data\OrderItemInterface;
1515
use Magento\Sales\Api\OrderItemRepositoryInterface;
1616
use Magento\Sales\Api\OrderRepositoryInterface;
17-
use Magento\Sales\Model\Order;
1817

1918
/**
2019
* Data provider for order items
@@ -138,6 +137,7 @@ private function fetch()
138137
'product_sku' => $orderItem->getSku(),
139138
'product_url_key' => $associatedProduct ? $associatedProduct->getUrlKey() : null,
140139
'product_type' => $orderItem->getProductType(),
140+
'discounts' => $this->getDiscountDetails($associatedOrder, $orderItem),
141141
'product_sale_price' => [
142142
'value' => $orderItem->getPrice(),
143143
'currency' => $associatedOrder->getOrderCurrencyCode()
@@ -226,7 +226,10 @@ private function getDiscountDetails(OrderInterface $associatedOrder, OrderItemIn
226226

227227
$discounts [] = [
228228
'label' => $associatedOrder->getDiscountDescription() ?? "null",
229-
'amount' => ['value' => $orderItem->getDiscountAmount() ?? 0, 'currency' => $associatedOrder->getOrderCurrencyCode()]
229+
'amount' => [
230+
'value' => $orderItem->getDiscountAmount() ?? 0,
231+
'currency' => $associatedOrder->getOrderCurrencyCode()
232+
]
230233
];
231234
return $discounts;
232235
}

0 commit comments

Comments
 (0)