Hi
I want to do to the region was selected immediately, and activated the city field ( for example as a country)
Did so, but I can't help to find the error
<div class="row">
<h4><?php _e('Region', 'zara') ; ?></h4>
[b]<?php
//
$region = Region::newInstance()->listAll();
if(count($region) <= 1) {
$region = $region[0];
}
?>[/b]
[b] <?php if(count($aRegions) >= 1 ) { ?>[/b]
<select id="regionId" name="sRegion" <?php if(Params::getParam('sRegion') == '' && Params::getParam('region')) {?>disabled<?php } ?>>
<option value=""><?php osc_esc_html(__('Select a region', 'zara')); ?></option>
<?php if(isset($aRegions) && !empty($aRegions) && $aRegions <> '' [b]&& count($aRegions) >= 1) { ?>[/b]
<?php foreach ($aRegions as $region) {?>
<option value="<?php echo $region['pk_i_id']; ?>" <?php if(Params::getParam('sRegion') == $region['pk_i_id'] or Params::getParam('sRegion') == $region['s_name']) { ?>selected="selected"<?php } ?>><?php echo osc_esc_html($region['s_name']); ?></option>
<?php } ?>
<?php } ?>
</select>
<?php } else { ?>
<input type="text" name="sRegion" id="sRegion-side" value="<?php echo Params::getParam('sRegion'); ?>" placeholder="<?php echo osc_esc_html(__('Enter a region', 'zara')); ?>" />
<?php } ?>
</div>
<?php
$current_region = Params::getParam('region') <> '' ? Params::getParam('region') : Params::getParam('sRegion');
if(!is_numeric($current_region) && $current_region <> '') {
$reg = Region::newInstance()->findByName($current_region);
$current_region = $reg['pk_i_id'];
}
if($current_region <> '' && !empty($current_region)) {
$aCities = City::newInstance()->findByRegion($current_region);
} else {
$aCities = '';
}
?>