[-] FO : Do not suggest states that are not active
This commit is contained in:
1 parent
f768081aa0
commit
b672b3281e
2 files changed
+5
-3
No files matched your search
+2
-1
@@ -482,7 +482,8 @@ class CarrierCore extends ObjectModel
|
|||||||
$countries[$country['id_country']] = $country;
|
$countries[$country['id_country']] = $country;
|
||||||
foreach ($states as &$state)
|
foreach ($states as &$state)
|
||||||
if (isset($countries[$state['id_country']])) /* Does not keep the state if its country has been disabled and not selected */
|
if (isset($countries[$state['id_country']])) /* Does not keep the state if its country has been disabled and not selected */
|
||||||
$countries[$state['id_country']]['states'][] = $state;
|
if ($state['active'] == 1)
|
||||||
|
$countries[$state['id_country']]['states'][] = $state;
|
||||||
|
|
||||||
return $countries;
|
return $countries;
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-2
@@ -82,7 +82,7 @@ class CountryCore extends ObjectModel
|
|||||||
'zip_code_format' => array('type' => self::TYPE_STRING, 'validate' => 'isZipCodeFormat'),
|
'zip_code_format' => array('type' => self::TYPE_STRING, 'validate' => 'isZipCodeFormat'),
|
||||||
'display_tax_label' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true),
|
'display_tax_label' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool', 'required' => true),
|
||||||
|
|
||||||
// Lang fields
|
/* Lang fields */
|
||||||
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
|
'name' => array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 64),
|
||||||
),
|
),
|
||||||
'associations' => array(
|
'associations' => array(
|
||||||
@@ -132,7 +132,8 @@ class CountryCore extends ObjectModel
|
|||||||
if ($list_states)
|
if ($list_states)
|
||||||
foreach (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'state` ORDER BY `name` ASC') as $state)
|
foreach (Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS('SELECT * FROM `'._DB_PREFIX_.'state` ORDER BY `name` ASC') as $state)
|
||||||
if (isset($countries[$state['id_country']])) /* Does not keep the state if its country has been disabled and not selected */
|
if (isset($countries[$state['id_country']])) /* Does not keep the state if its country has been disabled and not selected */
|
||||||
$countries[$state['id_country']]['states'][] = $state;
|
if ($state['active'] == 1)
|
||||||
|
$countries[$state['id_country']]['states'][] = $state;
|
||||||
|
|
||||||
return $countries;
|
return $countries;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user