Skip to content

Commit 5d3043e

Browse files
committed
ACP2E-420: Price in a Scheduled Update divided by 1000 depending on the Locale
1 parent 5c4be19 commit 5d3043e

File tree

3 files changed

+0
-71
lines changed

3 files changed

+0
-71
lines changed

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

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
use Magento\Ui\Component\Form\Element\ActionDelete;
2424
use Magento\Ui\Component\Form\Element\DataType\Text;
2525
use Magento\Ui\Component\Form\Element\DataType\Number;
26-
use Magento\Framework\Locale\CurrencyInterface;
2726

2827
/**
2928
* Data provider for "Customizable Options" panel
@@ -1176,26 +1175,4 @@ protected function getCurrencySymbol()
11761175
{
11771176
return $this->storeManager->getStore()->getBaseCurrency()->getCurrencySymbol();
11781177
}
1179-
1180-
/**
1181-
* Format price
1182-
*
1183-
* @param mixed $value
1184-
* @return string
1185-
* @since 101.0.0
1186-
*/
1187-
protected function formatPrice($value)
1188-
{
1189-
if (!is_numeric($value)) {
1190-
return null;
1191-
}
1192-
1193-
// phpcs:ignore Magento2.Functions.DiscouragedFunction
1194-
$roundValue = call_user_func([\Zend_Locale_Math::class, 'round'], $value, 2);
1195-
1196-
// phpcs:ignore Magento2.Functions.DiscouragedFunction
1197-
$value = call_user_func([\Zend_Locale_Math::class, 'normalize'], $roundValue);
1198-
1199-
return $value;
1200-
}
12011178
}

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

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
use Magento\Framework\App\RequestInterface;
2828
use Magento\Framework\AuthorizationInterface;
2929
use Magento\Framework\Filter\Translit;
30-
use Magento\Framework\Locale\CurrencyInterface;
3130
use Magento\Framework\Stdlib\ArrayManager;
3231
use Magento\Store\Model\StoreManagerInterface;
3332
use Magento\Ui\Component\Form\Element\Wysiwyg as WysiwygElement;
@@ -1093,25 +1092,4 @@ private function calculateGroupCode(AttributeGroupInterface $group)
10931092

10941093
return $attributeGroupCode;
10951094
}
1096-
1097-
/**
1098-
* Format price according to the locale of the currency
1099-
*
1100-
* @param mixed $value
1101-
* @return string
1102-
*/
1103-
protected function formatPrice($value)
1104-
{
1105-
if (!is_numeric($value)) {
1106-
return null;
1107-
}
1108-
1109-
// phpcs:ignore Magento2.Functions.DiscouragedFunction
1110-
$roundValue = call_user_func([\Zend_Locale_Math::class, 'round'], $value, 2);
1111-
1112-
// phpcs:ignore Magento2.Functions.DiscouragedFunction
1113-
$value = call_user_func([\Zend_Locale_Math::class, 'normalize'], $roundValue);
1114-
1115-
return $value;
1116-
}
11171095
}

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

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -411,27 +411,6 @@ protected function customizeNameListeners(array $meta)
411411
return $this->arrayManager->merge($urkKeyPath . static::META_CONFIG_PATH, $meta, $urlKeyConfig);
412412
}
413413

414-
/**
415-
* Format price
416-
*
417-
* @param mixed $value
418-
* @return string
419-
* @since 101.0.0
420-
*/
421-
protected function formatPrice($value)
422-
{
423-
if (!is_numeric($value)) {
424-
return null;
425-
}
426-
427-
// phpcs:ignore Magento2.Functions.DiscouragedFunction
428-
$roundValue = call_user_func([\Zend_Locale_Math::class, 'round'], $value, 2);
429-
// phpcs:ignore Magento2.Functions.DiscouragedFunction
430-
$value = call_user_func([\Zend_Locale_Math::class, 'normalize'], $roundValue);
431-
432-
return $value;
433-
}
434-
435414
/**
436415
* Format number according precision of input
437416
*
@@ -446,11 +425,6 @@ protected function formatNumber($value)
446425
}
447426

448427
$value = (float)$value;
449-
$precision = strlen(substr(strrchr($value, "."), 1));
450-
// phpcs:ignore Magento2.Functions.DiscouragedFunction
451-
$roundValue = call_user_func([\Zend_Locale_Math::class, 'round'], $value, $precision);
452-
// phpcs:ignore Magento2.Functions.DiscouragedFunction
453-
$value = call_user_func([\Zend_Locale_Math::class, 'normalize'], $roundValue);
454428

455429
return $value;
456430
}

0 commit comments

Comments
 (0)