Skip to content

Commit 1442d12

Browse files
committed
ACP2E-3874: Order "base_row_total" and "row_total" show single item price in REST API response
1 parent f0c8088 commit 1442d12

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

app/code/Magento/Sales/Block/Adminhtml/Items/Column/DefaultColumn.php

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,11 @@ public function getSku()
123123
public function getTotalAmount($item)
124124
{
125125
$storeId = $item->getStoreId();
126-
$total = $this->displaySalesPricesInclTax($storeId) ? $item->getPriceInclTax()
127-
: $item->getPrice();
128-
129-
$totalAmount = $this->displaySalesPricesInclTax($storeId)
130-
? $total - $item->getDiscountAmount() - $item->getTaxAmount()
131-
: $total - $item->getDiscountAmount();
132-
126+
if ($this->displaySalesPricesInclTax($storeId)) {
127+
$totalAmount = $item->getRowTotalInclTax() - $item->getDiscountAmount() - $item->getTaxAmount();
128+
} else {
129+
$totalAmount = $item->getRowTotal() - $item->getDiscountAmount();
130+
}
133131
return $totalAmount;
134132
}
135133

@@ -142,13 +140,12 @@ public function getTotalAmount($item)
142140
public function getBaseTotalAmount($item)
143141
{
144142
$storeId = $item->getStoreId();
145-
$baseTotal = $this->displaySalesPricesInclTax($storeId) ? $item->getBasePriceInclTax()
146-
: $item->getBasePrice();
147-
148-
$baseTotalAmount = $this->displaySalesPricesInclTax($storeId)
149-
? $baseTotal - $item->getBaseDiscountAmount() - $item->getBaseTaxAmount()
150-
: $baseTotal - $item->getBaseDiscountAmount();
151-
143+
if ($this->displaySalesPricesInclTax($storeId)) {
144+
$baseTotalAmount = $item->getBaseRowTotalInclTax()
145+
- $item->getBaseDiscountAmount() - $item->getBaseTaxAmount();
146+
} else {
147+
$baseTotalAmount = $item->getBaseRowTotal() - $item->getBaseDiscountAmount();
148+
}
152149
return $baseTotalAmount;
153150
}
154151

0 commit comments

Comments
 (0)