Advertisement:

Author Topic: How to change the default search engine feature from categories to region?  (Read 241 times)

hectorj

  • Newbie
  • *
  • Posts: 19
In the default search feature it doesn´t makes any sense to search  for  ie:PHP programmer (or whatever keyword your enter) and the have to select the category, the correct way to do it is to select the region or city.

So the question is how can I or any one to change the drop down selectior menu from categories to region?

This will make a much more sense.

I´ll appreciate your support.

thanks in advabce.

patrickFromCroatia

  • Hero Member
  • *****
  • Posts: 763
Hello,

What theme do you use? You want to show region selector before/instead category selector, right?

Regards.

hectorj

  • Newbie
  • *
  • Posts: 19
Re: How to change the default search engine feature from categories to region?
« Reply #2 on: February 02, 2019, 10:26:48 pm »
Thanks
YEs  I want ot show region which the correct

It´s tehd efault theme that´s comes with the free version

Thanks


marius-ciclistu

  • issues
  • Hero Member
  • *
  • Posts: 1619
  • "BE GRATEFUL TO THOSE THAT SUPPORTED YOU"
Re: How to change the default search engine feature from categories to region?
« Reply #3 on: February 02, 2019, 10:45:17 pm »
Categories are less than locations:)

patrickFromCroatia

  • Hero Member
  • *****
  • Posts: 763
Re: How to change the default search engine feature from categories to region?
« Reply #4 on: February 03, 2019, 11:58:22 pm »
On which dropdown you mean? Header or search sidebar?

Regards.

hectorj

  • Newbie
  • *
  • Posts: 19
Re: How to change the default search engine feature from categories to region?
« Reply #5 on: February 06, 2019, 09:12:33 pm »
In the header please.

Please tell me how to change it, I think I can edit the code is need it, just need to know where. I do really appreciate it
Thanks

patrickFromCroatia

  • Hero Member
  • *****
  • Posts: 763
Re: How to change the default search engine feature from categories to region?
« Reply #6 on: February 06, 2019, 09:20:40 pm »
In header.php replace

Code: [Select]
            <?php  if ( osc_count_categories() ) { ?>
                <div class="cell selector">
                    <?php osc_categories_select('sCategory'null__('Select a category''bender')) ; ?>
                </div>
                <div class="cell reset-padding">
            <?php  } else { ?>
                <div class="cell">
            <?php  ?>

with

Code: [Select]
<div class="cell selector">
    <?php
    $name 
'sRegion';
    
$id 'sRegion';
    
$label __('Select a region');
    
$aRegions Region::newInstance()->listAll();
    
$html  '<select name="'.$name.'" id="'.$id.'">';
    
$html .= '<option value="" id="sRegionSelect">'.$label.'</option>';
    foreach(
$aRegions as $region) {
$html .= '<option value="'$region['pk_i_id'].'">'$region['s_name'].'</option>';
    }
    
$html .= '</select>';

    echo 
$html;
    
?>

</div>
<div class="cell reset-padding">

Regards.

hectorj

  • Newbie
  • *
  • Posts: 19
Re: How to change the default search engine feature from categories to region?
« Reply #7 on: February 06, 2019, 10:34:28 pm »
got it I will try
Thanks for your support
Regards
Hector J

hectorj

  • Newbie
  • *
  • Posts: 19
Re: How to change the default search engine feature from categories to region?
« Reply #8 on: February 06, 2019, 11:57:10 pm »
Thanks for tip it worked fine