Fixed: The display of the fields. The price values displayed in the catalog price rules on edit

This commit is contained in:
vishalsingh.qlo325
2024-05-07 09:58:31 +05:30
parent 8dcfc9e892
commit f6b0be8e1a

View File

@@ -171,6 +171,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
'label' => $this->l('Name'),
'name' => 'name',
'maxlength' => 32,
'col' => 3,
'required' => true,
'hint' => $this->l('Forbidden characters').' <>;=#{}'
),
@@ -222,8 +223,8 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
'name' => 'price',
'disabled' => ($this->object->price == -1 ? 1 : 0),
'maxlength' => 10,
'suffix' => $this->context->currency->getSign('right'),
'suffix' => $this->context->currency->sign,
'col' => 3,
),
array(
'type' => 'checkbox',
@@ -279,6 +280,7 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
'type' => 'text',
'label' => $this->l('Reduction'),
'name' => 'reduction',
'col' => 3,
'required' => true,
),
),
@@ -298,14 +300,14 @@ class AdminSpecificPriceRuleControllerCore extends AdminController
$price = $this->getFieldValue($this->object, 'price');
if ($price != -1 && Validate::isPrice($price)) {
$price = number_format($price, 6);
$price = number_format($price, 6, '.', '');
} else {
$price = '';
}
$reduction = $this->getFieldValue($this->object, 'reduction');
if (Validate::isPrice($reduction)) {
$reduction = number_format($reduction, 6);
$reduction = number_format($reduction, 6, '.', '');
} else {
$reduction = 0;
}