Advertisement:

Author Topic: (Solved) 2 country not display  (Read 818 times)

data99

  • Full Member
  • ***
  • Posts: 180
(Solved) 2 country not display
« on: April 04, 2015, 07:07:11 am »
I have added USA and Canada but they dont display different they show together mix up is there any way I can Display USA and Canada Region differently



is there any better way to display 2 country
« Last Edit: April 04, 2015, 11:15:20 pm by data99 »

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: 2 country not display
« Reply #1 on: April 04, 2015, 01:31:57 pm »
Hi,

Find this block on bender/main.php:

Code: [Select]
    <div class="widget-box">
        <?php if(osc_count_list_regions() > ) { ?>
        <div class="box location">
            <h3><strong><?php _e("Location"'bender') ; ?></strong></h3>
            <ul>
            <?php while(osc_has_list_regions() ) { ?>
                <li><a href="<?php echo osc_list_region_url(); ?>"><?php echo osc_list_region_name() ; ?> <em>(<?php echo osc_list_region_items() ; ?>)</em></a></li>
            <?php ?>
            </ul>
        </div>
        <?php ?>
    </div>

and replace it with:

Code: [Select]
    <div class="widget-box">
        <?php while(osc_has_list_countries() ) {  
            if(
osc_count_list_regions(osc_list_country_code()) > ) { ?>

                <div class="box location">
                    <h3><strong><?php echo osc_list_country_name() ; ?></strong></h3>
                    <ul>
                    <?php while(osc_has_list_regions(osc_list_country_code()) ) { ?>
                            <li><a href="<?php echo osc_list_region_url(); ?>"><?php echo osc_list_region_name() ; ?> <em>(<?php echo osc_list_region_items() ; ?>)</em></a></li>
                            <?php }
                    
View::newInstance()->_erase('list_regions');
                    } 
?>

                    </ul>
                    <br />
                </div>
        <?php ?>
    </div>

Regards

data99

  • Full Member
  • ***
  • Posts: 180
Re: 2 country not display
« Reply #2 on: April 04, 2015, 11:14:08 pm »
Thanks it worked

http://prntscr.com/6pk109

data99

  • Full Member
  • ***
  • Posts: 180
Re: (Solved) 2 country not display
« Reply #3 on: April 04, 2015, 11:19:15 pm »
How do I move USA on Top and Canada to Button

teseo

  • Hero Member
  • *****
  • Posts: 6169
Re: (Solved) 2 country not display
« Reply #4 on: April 05, 2015, 02:24:55 pm »
This will move USA to top and the rest will be shown in alphabetical order:

Replacement:

Code: [Select]
    <div class="widget-box">
        <?php osc_count_list_countries();
        
$countries View::newInstance()->_get('list_countries');

        foreach(
$countries as $key => $country) {
            if (
$country['country_code'] == 'US') {
                unset(
$countries[$key]) ;
                
array_unshift($countries$country);
            }
        }
        
View::newInstance()->_exportVariableToView('list_countries'$countries);

        while(
osc_has_list_countries() ) {
            if(
osc_count_list_regions(osc_list_country_code()) > ) { ?>

                <div class="box location">
                    <h3><strong><?php echo osc_list_country_name() ; ?></strong></h3>
                    <ul>
                    <?php while(osc_has_list_regions(osc_list_country_code()) ) { ?>
                            <li><a href="<?php echo osc_list_region_url(); ?>"><?php echo osc_list_region_name() ; ?> <em>(<?php echo osc_list_region_items() ; ?>)</em></a></li>
                            <?php }
                    
View::newInstance()->_erase('list_regions');
                    } 
?>

                    </ul>
                    <br />
                </div>
        <?php ?>
    </div>

Regards