Skip to content

Commit 052a845

Browse files
committed
ACP2E-420: Price in a Scheduled Update divided by 1000 depending on the Locale
1 parent 66fe5c0 commit 052a845

File tree

2 files changed

+5
-25
lines changed
  • app/code/Magento/Catalog
    • Test/Unit/Ui/DataProvider/Product/Form/Modifier
    • Ui/DataProvider/Product/Form/Modifier

2 files changed

+5
-25
lines changed

app/code/Magento/Catalog/Test/Unit/Ui/DataProvider/Product/Form/Modifier/EavTest.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -441,15 +441,6 @@ public function testModifyData()
441441
$this->searchResultsMock->expects($this->once())->method('getItems')
442442
->willReturn([$this->eavAttributeMock]);
443443

444-
$this->storeMock->expects(($this->once()))->method('getBaseCurrencyCode')
445-
->willReturn('en_US');
446-
$this->storeManagerMock->expects($this->once())->method('getStore')
447-
->willReturn($this->storeMock);
448-
$this->currencyMock->expects($this->once())->method('toCurrency')
449-
->willReturn('19.99');
450-
$this->currencyLocaleMock->expects($this->once())->method('getCurrency')
451-
->willReturn($this->currencyMock);
452-
453444
$this->assertEquals($sourceData, $this->eav->modifyData([]));
454445
}
455446

app/code/Magento/Catalog/Ui/DataProvider/Product/Form/Modifier/Eav.php

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1100,21 +1100,6 @@ private function calculateGroupCode(AttributeGroupInterface $group)
11001100
return $attributeGroupCode;
11011101
}
11021102

1103-
/**
1104-
* The getter function to get the locale currency for real application code
1105-
*
1106-
* @return \Magento\Framework\Locale\CurrencyInterface
1107-
*
1108-
* @deprecated 101.0.0
1109-
*/
1110-
private function getLocaleCurrency()
1111-
{
1112-
if ($this->localeCurrency === null) {
1113-
$this->localeCurrency = \Magento\Framework\App\ObjectManager::getInstance()->get(CurrencyInterface::class);
1114-
}
1115-
return $this->localeCurrency;
1116-
}
1117-
11181103
/**
11191104
* Format price according to the locale of the currency
11201105
*
@@ -1127,7 +1112,11 @@ protected function formatPrice($value)
11271112
return null;
11281113
}
11291114

1130-
$value = \Zend_Locale_Math::normalize(\Zend_Locale_Math::round($value, self::PRECISION));
1115+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
1116+
$roundValue = call_user_func([\Zend_Locale_Math::class, 'round'], $value, self::PRECISION);
1117+
1118+
// phpcs:ignore Magento2.Functions.DiscouragedFunction
1119+
$value = call_user_func([\Zend_Locale_Math::class, 'normalize'], $roundValue);
11311120

11321121
return $value;
11331122
}

0 commit comments

Comments
 (0)