*

Larry12

  • **
  • 13 posts
Show location on homepage without Popup
« on: January 12, 2018, 08:01:23 PM »
Hello,

How can I show the 'Select location' popup on the homepage without clicking the location icon? I want to be displayed without the popup.

Thanks,

Larry

*

MB Themes

Re: Show location on homepage without Popup
« Reply #1 on: January 12, 2018, 09:05:05 PM »
@Larry
You may try to add this code to footer.php:
Code: [Select]
<script>
$(document).ready(function(){
  $('#home-loc-open').click();
});
</script>
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Larry12

  • **
  • 13 posts
Re: Show location on homepage without Popup
« Reply #2 on: January 12, 2018, 09:50:10 PM »
Hello,

Thanks for your reply. If I add this code, the location popup auto appears when I enter the website. All I wanted was to place the location selection window directly on the homepage, with no popup, instead of the location icon. Could you please help me?

*

MB Themes

Re: Show location on homepage without Popup
« Reply #3 on: January 12, 2018, 10:04:27 PM »
You can copy it from item-send-friend.php
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

Larry12

  • **
  • 13 posts
Re: Show location on homepage without Popup
« Reply #4 on: January 12, 2018, 11:00:58 PM »
I've tried to copy the next code to main.php but it's not working. Where should I put it ?

Code: [Select]
<!-- 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) >= ) { ?>
              <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) >= && !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 ?>


*

MB Themes

Re: Show location on homepage without Popup
« Reply #5 on: January 13, 2018, 03:52:36 PM »
@Larry
What does not work? You may look for developer to do modifications for you if you do not have enough skills.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots