[-] BO: Fix #PSCFV-4890
This commit is contained in:
@@ -216,7 +216,7 @@ class AdminTaxRulesGroupControllerCore extends AdminController
|
|||||||
array(
|
array(
|
||||||
'type' => 'select',
|
'type' => 'select',
|
||||||
'label' => $this->l('Country:'),
|
'label' => $this->l('Country:'),
|
||||||
'name' => 'country[]',
|
'name' => 'country',
|
||||||
'id' => 'country',
|
'id' => 'country',
|
||||||
'options' => array(
|
'options' => array(
|
||||||
'query' => Country::getCountries($this->context->language->id),
|
'query' => Country::getCountries($this->context->language->id),
|
||||||
@@ -386,7 +386,15 @@ class AdminTaxRulesGroupControllerCore extends AdminController
|
|||||||
$behavior = (int)Tools::getValue('behavior');
|
$behavior = (int)Tools::getValue('behavior');
|
||||||
$description = pSQL(Tools::getValue('description'));
|
$description = pSQL(Tools::getValue('description'));
|
||||||
|
|
||||||
$this->selected_countries = Tools::getValue('country');
|
if ((int)($id_country = Tools::getValue('country')) == 0)
|
||||||
|
{
|
||||||
|
$countries = Country::getCountries($this->context->language->id);
|
||||||
|
$this->selected_countries = array();
|
||||||
|
foreach ($countries as $country)
|
||||||
|
$this->selected_countries[] = (int)$country['id_country'];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
$this->selected_countries = array($id_country);
|
||||||
$this->selected_states = Tools::getValue('states');
|
$this->selected_states = Tools::getValue('states');
|
||||||
|
|
||||||
if (empty($this->selected_states) || count($this->selected_states) == 0)
|
if (empty($this->selected_states) || count($this->selected_states) == 0)
|
||||||
@@ -435,14 +443,8 @@ class AdminTaxRulesGroupControllerCore extends AdminController
|
|||||||
$this->errors = array_merge($this->errors, $this->validateTaxRule($tr));
|
$this->errors = array_merge($this->errors, $this->validateTaxRule($tr));
|
||||||
|
|
||||||
if (count($this->errors) == 0)
|
if (count($this->errors) == 0)
|
||||||
{
|
|
||||||
if (!$tr->save())
|
if (!$tr->save())
|
||||||
$this->errors[] = Tools::displayError('An error has occurred: Can\'t save the current tax rule');
|
$this->errors[] = Tools::displayError('An error has occurred: Can\'t save the current tax rule');
|
||||||
else
|
|
||||||
Tools::redirectAdmin(
|
|
||||||
self::$currentIndex.'&'.$this->identifier.'='.$tr->id_tax_rules_group.'&conf=4&update'.$this->table.'&token='.$this->token
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user