Skip to content

Commit 53a4981

Browse files
authored
CC-33282: Display Commissions Amount in Backoffice and Merchant Portal UI (#10987)
Display Commissions Amount in Backoffice and Merchant Portal UI
1 parent 8a55e2e commit 53a4981

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

composer.json

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
},
4646
"suggest": {
4747
"spryker/checkout": "If you want to use Checkout plugins. ^4.0.0",
48+
"spryker/sales-merchant-commission-merchant-portal-gui": "Use this module if you want to use templates with merchant commission totals.",
4849
"spryker/sales-product-configuration-gui": "Add the module if you want to display order item configuration."
4950
},
5051
"autoload": {

src/Spryker/Zed/Sales/Business/Model/Order/OrderHydrator.php

+10-6
Original file line numberDiff line numberDiff line change
@@ -553,12 +553,16 @@ protected function hydrateOrderTotals(SpySalesOrder $orderEntity, OrderTransfer
553553
$taxTotalTransfer->setAmount($salesOrderTotalsEntity->getTaxTotal());
554554
$totalsTransfer->setTaxTotal($taxTotalTransfer);
555555

556-
$totalsTransfer->setExpenseTotal($salesOrderTotalsEntity->getOrderExpenseTotal());
557-
$totalsTransfer->setRefundTotal($salesOrderTotalsEntity->getRefundTotal());
558-
$totalsTransfer->setGrandTotal($salesOrderTotalsEntity->getGrandTotal());
559-
$totalsTransfer->setSubtotal($salesOrderTotalsEntity->getSubtotal());
560-
$totalsTransfer->setDiscountTotal($salesOrderTotalsEntity->getDiscountTotal());
561-
$totalsTransfer->setCanceledTotal($salesOrderTotalsEntity->getCanceledTotal());
556+
$plainTotal = $salesOrderTotalsEntity->toArray();
557+
unset($plainTotal['tax_total']);
558+
559+
$totalsTransfer->fromArray($plainTotal, true)
560+
->setExpenseTotal($salesOrderTotalsEntity->getOrderExpenseTotal())
561+
->setRefundTotal($salesOrderTotalsEntity->getRefundTotal())
562+
->setGrandTotal($salesOrderTotalsEntity->getGrandTotal())
563+
->setSubtotal($salesOrderTotalsEntity->getSubtotal())
564+
->setDiscountTotal($salesOrderTotalsEntity->getDiscountTotal())
565+
->setCanceledTotal($salesOrderTotalsEntity->getCanceledTotal());
562566

563567
$orderTransfer->setTotals($totalsTransfer);
564568
}

src/Spryker/Zed/Sales/Presentation/Detail/boxes/order-overview.twig

+7
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@
7373
<div class="col-xs-4">{{ order.totals.canceledTotal | default(0) | money(true, order.currencyIsoCode) }}</div>
7474
</div>
7575
</div>
76+
77+
{% include [
78+
'@SalesMerchantCommissionMerchantPortalGui/Partials/order-commission-totals.twig',
79+
'@SalesMerchantCommission/Partials/commission-totals.twig',
80+
] ignore missing with {
81+
order: order,
82+
} %}
7683
</div>
7784
</div>
7885

0 commit comments

Comments
 (0)