Skip to content

Commit ce673ad

Browse files
committed
Merge remote-tracking branch 'origin/AC-9758' into spartans_pr_04122023
2 parents 7d724b7 + 1b935ca commit ce673ad

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/code/Magento/QuoteGraphQl/Model/Resolver/CartPrices.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,15 @@ private function getAppliedTaxes(Total $total, string $currency): array
9898
$rates = [];
9999

100100
foreach ($appliedTaxes as $appliedTax) {
101+
$totalPercentage = $appliedTax['percent'];
101102
foreach ($appliedTax['rates'] as $appliedTaxRate) {
102103
$rateTitle = $appliedTaxRate['title'];
103104
if (!array_key_exists($rateTitle, $rates)) {
104105
$rates[$rateTitle] = 0.0;
105106
}
106-
$rates[$rateTitle] += $appliedTax['amount'];
107+
$percentage = $appliedTaxRate['percent'];
108+
$taxValue = ($percentage / $totalPercentage) * $appliedTax['amount'];
109+
$rates[$rateTitle] += round((float) $taxValue, 2);
107110
}
108111
}
109112

0 commit comments

Comments
 (0)