From da3a1c89c4df16d4de94e8511998c9bcfbfb342d Mon Sep 17 00:00:00 2001 From: "David.Owusu" Date: Fri, 14 Feb 2020 12:57:32 +0100 Subject: [PATCH] (MAGE2-269) [change] adjust total calculation of basket. --- Helper/BasketHelper.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Helper/BasketHelper.php b/Helper/BasketHelper.php index eb959b5d064..34006160813 100755 --- a/Helper/BasketHelper.php +++ b/Helper/BasketHelper.php @@ -71,8 +71,13 @@ public function convertQuoteToBasket(Quote $quote) $basketRequest = new Request(); $basketReferenceId = $basketTotals->getBasketReferenceId(); $basket = $basketRequest->getBasket(); + + $amountGrandTotal = $basketTotals->normalizeValue($quote->getGrandTotal()); + $amountTotalNet = $basketTotals->getSubtotalWithDiscountAndShipping(); + $basket->setCurrencyCode($basketTotals->getCurrencyCode()) - ->setAmountTotalNet($basketTotals->normalizeValue($quote->getGrandTotal())) + ->setAmountTotalNet($amountTotalNet) + ->setAmountTotalVat($amountGrandTotal - $amountTotalNet) ->setBasketReferenceId($basketReferenceId); /** @var Item $item */