Skip to content

Commit acd35f4

Browse files
author
Tang, Yu(ytang1)
committed
Merge pull request #130 from magento-fearless-kiwis/FearlessKiwis-MAGETWO-MAGETWO-45024-Shipping-Amount-Incorrect-Currency
[FearlessKiwis] Bug fix
2 parents 869f987 + 938156a commit acd35f4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

app/code/Magento/Quote/Model/Quote/Address/Total/Shipping.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ public function collect(
171171
$total->setBaseTotalAmount($this->getCode(), $rate->getPrice());
172172
$shippingDescription = $rate->getCarrierTitle() . ' - ' . $rate->getMethodTitle();
173173
$address->setShippingDescription(trim($shippingDescription, ' -'));
174-
$total->setShippingAmount($rate->getPrice());
174+
$total->setBaseShippingAmount($rate->getPrice());
175+
$total->setShippingAmount($amountPrice);
175176
$total->setShippingDescription($address->getShippingDescription());
176177
break;
177178
}

app/code/Magento/Quote/Test/Unit/Model/Quote/Address/Total/ShippingTest.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ protected function setUp()
7070
'Magento\Quote\Model\Quote\Address\Total',
7171
[
7272
'setShippingAmount',
73+
'setBaseShippingAmount',
7374
'setBaseTotalAmount',
7475
'setTotalAmount',
7576
'setShippingDescription',
@@ -229,9 +230,12 @@ public function testCollect()
229230
$this->priceCurrency->expects($this->once())
230231
->method('convert')
231232
->with(5, $this->store)
232-
->willReturn(5);
233+
->willReturn(10);
233234
$this->total->expects($this->once())
234235
->method('setShippingAmount')
236+
->with(10);
237+
$this->total->expects($this->once())
238+
->method('setBaseShippingAmount')
235239
->with(5);
236240
$this->rate->expects($this->once())
237241
->method('getCarrierTitle')

0 commit comments

Comments
 (0)