Skip to content

Commit 257edb5

Browse files
committed
AC-15664::Added modifications for multishipping shipping price issue
1 parent f6bd8c4 commit 257edb5

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

app/code/Magento/Multishipping/Block/Checkout/Overview.php

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,17 @@ public function getShippingAddressRate($address)
234234
public function getShippingPriceInclTax($address)
235235
{
236236
$rate = $address->getShippingRateByCode($address->getShippingMethod());
237-
$baseAmount = (float)$rate->getPrice();
238-
$baseTaxAmount = (float)$address->getBaseShippingTaxAmount();
239237
$store = $this->getQuote()->getStore();
240-
$converted = $store->getBaseCurrency()->convert($baseAmount + $baseTaxAmount, $store->getCurrentCurrencyCode());
238+
$baseCode = $store->getBaseCurrencyCode();
239+
$currentCode = $store->getCurrentCurrencyCode();
240+
if ($baseCode === $currentCode) {
241+
$displayAmount = (float)$rate->getPrice() + (float)$address->getShippingTaxAmount();
242+
return $this->formatPrice($displayAmount);
243+
}
244+
$baseAmount = (float)$rate->getPrice();
245+
$baseTaxAmount = $address->getBaseShippingTaxAmount();
246+
$baseTaxAmount = $baseTaxAmount !== null ? (float)$baseTaxAmount : 0.0;
247+
$converted = $store->getBaseCurrency()->convert($baseAmount + $baseTaxAmount, $currentCode);
241248
return $this->formatPrice($converted);
242249
}
243250

@@ -250,9 +257,14 @@ public function getShippingPriceInclTax($address)
250257
public function getShippingPriceExclTax($address)
251258
{
252259
$rate = $address->getShippingRateByCode($address->getShippingMethod());
253-
$baseAmount = (float)$rate->getPrice();
254260
$store = $this->getQuote()->getStore();
255-
$converted = $store->getBaseCurrency()->convert($baseAmount, $store->getCurrentCurrencyCode());
261+
$baseCode = $store->getBaseCurrencyCode();
262+
$currentCode = $store->getCurrentCurrencyCode();
263+
if ($baseCode === $currentCode) {
264+
return $this->formatPrice((float)$rate->getPrice());
265+
}
266+
$baseAmount = (float)$rate->getPrice();
267+
$converted = $store->getBaseCurrency()->convert($baseAmount, $currentCode);
256268
return $this->formatPrice($converted);
257269
}
258270

0 commit comments

Comments
 (0)