*

san37

  • ***
  • 89 posts
Region serach
« on: August 30, 2016, 09:31:21 AM »
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

Code: [Select]

<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) >= ) { ?>[/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 '';
              }
            
?>


*

MB Themes

Re: Region serach
« Reply #1 on: September 04, 2016, 07:52:54 PM »
@san37
When should be region auto-selected? There are many regions...
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

san37

  • ***
  • 89 posts
Re: Region serach
« Reply #2 on: September 05, 2016, 08:44:30 PM »
I have one region, I also want to do as a country, so it is automatically selected and then hide it : display none

*

MB Themes

Re: Region serach
« Reply #3 on: September 05, 2016, 08:59:05 PM »
@san37
Then you need to do it via javascript, pre-select last option of select box.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

san37

  • ***
  • 89 posts
Re: Region serach
« Reply #4 on: September 08, 2016, 06:55:13 PM »
telll me please the script is footer.php?
I can not find

*

MB Themes

Re: Region serach
« Reply #5 on: September 08, 2016, 07:13:59 PM »
@san37
As I told, you need to create it...
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots