Skip to content

Commit 348a66f

Browse files
committed
ACP2E-2303: Shipping prices do not include tax in the Shipping Method
- Fixed the issue and added the test coverage.
1 parent feedc93 commit 348a66f

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

app/code/Magento/Tax/Model/Config.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,9 @@ public function needPriceConversion($store = null)
921921
$res = false;
922922
$priceIncludesTax = $this->priceIncludesTax($store)
923923
|| $this->getNeedUseShippingExcludeTax()
924-
|| $this->shippingPriceIncludesTax($store);
924+
|| $this->shippingPriceIncludesTax($store)
925+
|| $this->displayCartShippingInclTax()
926+
|| $this->displayCartShippingBoth();
925927
if ($priceIncludesTax) {
926928
switch ($this->getPriceDisplayType($store)) {
927929
case self::DISPLAY_TYPE_EXCLUDING_TAX:

app/code/Magento/Tax/Test/Unit/Model/ConfigTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,4 +381,20 @@ public function dataProviderScopeConfigMethods(): array
381381
]
382382
];
383383
}
384+
385+
/**
386+
* Tests check if necessary do product price conversion
387+
*
388+
* @return void
389+
*/
390+
public function testNeedPriceConversion(): void
391+
{
392+
$scopeConfigMock = $this->getMockForAbstractClass(ScopeConfigInterface::class);
393+
$scopeConfigMock
394+
->method('getValue')
395+
->willReturn(true);
396+
/** @var Config */
397+
$model = new Config($scopeConfigMock);
398+
$this->assertEquals(true, $model->needPriceConversion());
399+
}
384400
}

0 commit comments

Comments
 (0)