*

alboy

  • ***
  • 39 posts
Location style change
« on: April 30, 2020, 11:41:29 PM »
Hello !
 Is it possible to change location picker style in post listing page? From interactive selection box , to make it cascading drop down selection ( Like the category selection option).

*

MB Themes

Re: Location style change
« Reply #1 on: May 01, 2020, 02:55:55 PM »
@redi
Yes, check bender theme how it is integrated here.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

alboy

  • ***
  • 39 posts
Re: Location style change
« Reply #2 on: May 02, 2020, 02:09:33 AM »
i really tried but i made a mess! Can help what i have to replace here?
 This is bender code :

<div class="box location">
                            <h2><?php _e('Listing Location', 'bender'); ?></h2>
                            <?php if(count(osc_get_countries()) > 1) { ?>
                            <div class="control-group">
                                <label class="control-label" for="country"><?php _e('Country', 'bender'); ?></label>
                                <div class="controls">
                                    <?php ItemForm::country_select(osc_get_countries(), osc_user()); ?>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="regionId"><?php _e('Region', 'bender'); ?></label>
                                <div class="controls">
                                    <?php
                                    if (bender_default_location_show_as() == 'dropdown') {
                                        if($edit) {
                                            ItemForm::region_select(osc_get_regions(osc_item_country_code()), osc_item());
                                        } else {
                                            ItemForm::region_select(osc_get_regions(osc_user_field('fk_c_country_code')), osc_user());
                                        }
                                    } else {
                                        if($edit) {
                                            ItemForm::region_text(osc_item());
                                        } else {
                                            ItemForm::region_text(osc_user());
                                        }
                                    }
                                    ?>
                                </div>
                            </div>
                            <?php
                            } else {
                                $aRegions = array();
                                $_countryCode = '';
                                $aCountries = osc_get_countries();
                                if(count($aCountries)>0) {
                                    $_countryCode = $aCountries[0]['pk_c_code'];
                                    $aRegions = osc_get_regions($_countryCode);
                                }
                                ?>
                            <input type="hidden" id="countryId" name="countryId" value="<?php echo osc_esc_html($_countryCode); ?>"/>
                            <div class="control-group">
                                <label class="control-label" for="region"><?php _e('Region', 'bender'); ?></label>
                                <div class="controls">
                                  <?php
                                    if (bender_default_location_show_as() == 'dropdown') {
                                        if($edit) {
                                            ItemForm::region_select($aRegions, osc_item());
                                        } else {
                                            ItemForm::region_select($aRegions, osc_user());
                                        }
                                    } else {
                                        if($edit) {
                                            ItemForm::region_text(osc_item());
                                        } else {
                                            ItemForm::region_text(osc_user());
                                        }
                                    }
                                    ?>
                                </div>
                            </div>
                            <?php } ?>

                            <div class="control-group">
                                <label class="control-label" for="city"><?php _e('City', 'bender'); ?></label>
                                <div class="controls">
                                    <?php
                                    if (bender_default_location_show_as() == 'dropdown') {
                                        if($edit) {
                                            ItemForm::city_select(null, osc_item());
                                        } else { // add new item
                                            ItemForm::city_select(osc_get_cities(osc_user_region_id()), osc_user());
                                        }
                                    } else {
                                        ItemForm::city_text(osc_user());
                                    }
                                    ?>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="cityArea"><?php _e('City Area', 'bender'); ?></label>
                                <div class="controls">
                                    <?php ItemForm::city_area_text(osc_user()); ?>
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="address"><?php _e('Address', 'bender'); ?></label>
                                <div class="controls">
                                  <?php ItemForm::address_text(osc_user()); ?>
                                </div>
                            </div>
                        </div>

This is gamma code:

<fieldset class="s2">
        <h2><?php _e('Location', 'gamma'); ?></h2>

        <div class="in">
          <div id="location-picker" class="loc-picker picker-v2 ctr-<?php echo (gam_count_countries() == 1 ? 'one' : 'more'); ?>">
            <label for="term2"><span><?php _e('Where is your item located?', 'gamma'); ?></span><span class="req">*</span></label>

            <div class="mini-box">
              <input type="text" id="term2" class="term2" placeholder="<?php _e('City/Region', 'gamma'); ?>" value="<?php echo gam_get_term('', $prepare['i_country'], $prepare['i_region'], $prepare['i_city']); ?>" autocomplete="off" readonly/>
              <i class="fa fa-angle-down"></i>
            </div>

            <div class="shower-wrap">
              <div class="shower" id="shower">
                <?php echo gam_locbox_short($prepare['i_country'], $prepare['i_region'], $prepare['i_city']); ?>
                <a href="#" class="btn btn-primary mbBg loc-confirm isMobile"><i class="fa fa-check"></i></a>

                <div class="button-wrap isTablet isDesktop">
                  <a href="#" class="btn btn-primary mbBg loc-confirm"><?php _e('Continue', 'gamma'); ?></a>
                </div>
              </div>
            </div>

            <div class="loader"></div>
          </div>


          <div class="loc-more">
            <div class="row city-area">
              <label for="address"><?php _e('City Area', 'gamma'); ?></label>
              <div class="input-box"><?php ItemForm::city_area_text($prepare); ?></div>
            </div>

            <div class="row address">
              <label for="address"><?php _e('Address', 'gamma'); ?></label>
              <div class="input-box"><?php ItemForm::address_text($prepare); ?></div>
            </div>

            <div class="row zip">
              <label for="address"><?php _e('ZIP', 'gamma'); ?></label>
              <div class="input-box"><?php ItemForm::zip_text($prepare); ?></div>
            </div>

          </div>
        </div>
      </fieldset>

      <fieldset class="s3">