Page user profile load
« on: February 18, 2016, 09:33:14 AM »
Hello,
I have a problem with the page user profile :  it block or load in 5- 10 min. I have 8 country installed with all city.

 After I choose a region and want to choose the city I have all city from all country.

If you know what I can do in this case.

Thanks for help.

The website is xannia.com

*

MB Themes

Re: Page user profile load
« Reply #1 on: February 22, 2016, 09:59:26 AM »
@victorelectronics
Thanks for reporting, this is caused by loading everything at once.
Please go to user-profile.php and do this:

Find this code:
Code: [Select]
<div class="row">
  <label for="country"><?php _e('Country''sofia'); ?> <sup>*</sup></label>
  <?php UserForm::country_select(osc_get_countries(), osc_user()); ?>
</div>

above this block, place following code:
Code: [Select]
        <?php $user osc_user(); ?>
        <?php $country Country::newInstance()->listAll(); ?>

        <?php 
          
if(count($country) <= 1) {
            
$u_country Country::newInstance()->listAll();
            
$u_country $u_country[0];
            
$user['fk_c_country_code'] = $u_country['pk_c_code'];
          }
        
?>


Now find this block:
Code: [Select]
              <div class="row">
                <label for="country"><?php _e('Country''sofia'); ?> <sup>*</sup></label>
                <?php UserForm::country_select(osc_get_countries(), osc_user()); ?>
              </div>
              <div class="row">
                <label for="region"><?php _e('Region''sofia'); ?> <sup>*</sup></label>
                <?php UserForm::region_select(osc_get_regions(), osc_user()); ?>
              </div>
              <div class="row">
                <label for="city"><?php _e('City''sofia'); ?> <sup>*</sup></label>
                <?php UserForm::city_select(osc_get_cities(), osc_user()); ?>
              </div>

Replace it with:
Code: [Select]
              <div class="row">
                <label for="country"><?php _e('Country''sofia'); ?> <sup>*</sup></label>
                <?php UserForm::country_select(Country::newInstance()->listAll(), osc_user()); ?>
              </div>
              <div class="row">
                <label for="region"><?php _e('Region''sofia'); ?> <sup>*</sup></label>
                <?php UserForm::region_select($user['fk_c_country_code'] <> '' osc_get_regions($user['fk_c_country_code']) : ''osc_user()) ; ?>
              </div>
              <div class="row">
                <label for="city"><?php _e('City''sofia'); ?> <sup>*</sup></label>
                <?php UserForm::city_select($user['fk_i_region_id'] <> '' osc_get_cities($user['fk_i_region_id']) : ''osc_user()) ; ?>
              </div>

Let me know if it helped ;)
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

Re: Page user profile load
« Reply #2 on: February 22, 2016, 03:38:36 PM »
OK.
Thank you. i will do it .