I've tried to copy the next code to main.php but it's not working. Where should I put it ?
<!-- LOCATION SELECT BUTTON ON HOME PAGE -->
<?php
<fieldset>
<div class="head">
<h2><?php _e('Seleccionar ubicacič´¸n', 'zara'); ?></h2>
<a href="#" class="def-but fw-close-button round3"><i class="fa fa-times"></i> <?php _e('Close', 'zara'); ?></a>
</div>
<div class="left">
<img src="<?php echo osc_base_url(); ?>oc-content/themes/<?php echo osc_current_web_theme(); ?>/images/home-loc-form.jpg" />
</div>
<div class="middle">
<?php $aCountries = Country::newInstance()->listAll(); ?>
<div class="row"<?php if(count($aCountries) <= 1) {?> style="display:none;"<?php } ?>>
<h4><?php _e('Country', 'zara') ; ?></h4>
<?php
// IF THERE IS JUST 1 COUNTRY, PRE-SELECT IT TO ENABLE REGION DROPDOWN
$s_country = Country::newInstance()->listAll();
if(count($s_country) <= 1) {
$s_country = $s_country[0];
}
?>
<select id="countryId" name="sCountry">
<option value=""><?php _e('Select a country', 'zara'); ?></option>
<?php foreach ($aCountries as $country) {?>
<option value="<?php echo $country['pk_c_code']; ?>" <?php if(Params::getParam('sCountry') <> '' && (Params::getParam('sCountry') == $country['pk_c_code'] or Params::getParam('sCountry') == $country['s_name']) or $s_country['pk_c_code'] <> '' && $s_country['pk_c_code'] = $country['pk_c_code']) { ?>selected="selected"<?php } ?>><?php echo $country['s_name'] ; ?></option>
<?php
if(Params::getParam('sCountry') <> '' && (Params::getParam('sCountry') == $country['pk_c_code'] or Params::getParam('sCountry') == $country['s_name']) or $s_country['pk_c_code'] <> '' && $s_country['pk_c_code'] = $country['pk_c_code']) {
$current_country_code = $country['pk_c_code'];
}
?>
<?php } ?>
</select>
</div>
<?php
$current_country = Params::getParam('country') <> '' ? Params::getParam('country') : Params::getParam('sCountry');
if($current_country <> '') {
$aRegions = Region::newInstance()->findByCountry($current_country_code);
} else {
if(osc_count_countries() <= 1) {
$aRegions = Region::newInstance()->findByCountry($s_country['pk_c_code']);
} else {
$aRegions = '';
}
}
?>
<div class="row">
<h4><?php _e('Region', 'zara') ; ?></h4>
<?php if(count($aRegions) >= 1 ) { ?>
<select id="regionId" name="sRegion" <?php if(Params::getParam('sRegion') == '' && Params::getParam('region')) {?>disabled<?php } ?>>
<option value=""><?php _e('Select a region', 'zara'); ?></option>
<?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 $region['s_name']; ?></option>
<?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')); ?>" />-->
<select id="regionId" name="sRegion" disabled><option value=""><?php _e('Select a region', 'zara'); ?></option></select>
<?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 = '';
}
?>
<div class="row">
<h4><?php _e('City', 'zara') ; ?></h4>
<?php if(count($aCities) >= 1 && !empty($aCities) ) { ?>
<select name="sCity" id="cityId" <?php if(Params::getParam('sCity') == '' && Params::getParam('city') == '') {?>disabled<?php } ?>>
<option value=""><?php _e('Select a city', 'zara'); ?></option>
<?php foreach ($aCities as $city) {?>
<option value="<?php echo $city['pk_i_id']; ?>" <?php if(Params::getParam('sCity') == $city['pk_i_id'] or Params::getParam('sCity') == $city['s_name']) { ?>selected="selected"<?php } ?>><?php echo $city['s_name']; ?></option>
<?php } ?>
</select>
<?php } else { ?>
<!--<input type="text" name="sCity" id="sCity-side" value="<?php echo Params::getParam('sCity'); ?>" placeholder="<?php echo osc_esc_html(__('Enter a city', 'zara')); ?>" />-->
<select id="cityId" name="sCity" disabled><option value=""><?php _e('Select a city', 'zara'); ?></option></select>
<?php } ?>
</div>
<div class="row r-but">
<button type="submit" id="blue"><?php _e('Search', 'zara') ; ?></button>
</div>
<div class="row r-clean">
<a target="_top" href="<?php echo osc_search_url(array('page' => 'search', 'cookie-action-side' => 'done'));?>" class="clear-search tr1" title="<?php echo osc_esc_html(__('Clear location', 'zara')); ?>"><i class="fa fa-eraser"></i><?php _e('Clean search', 'zara'); ?></a>
</div>
</div>
</fieldset>
</form>
<?php } ?>