*

annunci

  • ***
  • 60 posts
Change the module for entering the region and city
« on: October 04, 2017, 08:45:44 PM »
Hi, I have a request to do that maybe it is difficult to realize (but not impossible as far as I know) as a monster in the images, the stage in which the user must enter the region and/or the city, I would like it in the basic theme of oscalss.org, ie with a dropdown menu selectable. I want this because I'm finding that many users who insert the ad on my site, when they enter the region or the city, do not select it then from those that the search engine finds, but they just type the city in the box and then click Next To publish your ad. This makes the ad appear without a city or region, and that's not good. Having a selectable drop-down menu in dropdown, then first the region and then the city according to the region chosen, I think is the most logical choice to fix this problem. Can you do that?

*

Ivanko

  • *****
  • 391 posts
Re: Change the module for entering the region and city
« Reply #1 on: October 04, 2017, 09:49:12 PM »
In item-post for example you need to do something like:

Code: [Select]
<div id="" style="">
<?php $prepare['i_country'] = ItemForm::country_select( ) ; ?>
</div>
<div class="list">
<label for="term"><?php _e('Location''core'); ?></label>
<?php $prepare['i_region'] =ItemForm::region_select(osc_get_regions(osc_user_country_code()), osc_user()) ;?>
</div>                         
<label for="term"><?php _e('Location''core'); ?></label>
<div class="row" >
<?php $prepare['s_city']  =  ItemForm::city_select(osc_get_cities(osc_user_region_id()), osc_user()) ;?>
</div>

in the end of item.post before footer.php add
Code: [Select]
<?php ItemForm::location_javascript(); ?>
Then you can get something like on screenshot, also same story need to do in item-edit.php

more explanation here :
https://doc.osclass.org/Changing_between_drop-down_and_autocomplete_for_locations

Re: Change the module for entering the region and city
« Reply #2 on: October 06, 2017, 01:09:21 PM »
please  i dont get this your explanation well
how to do that in more explain pls 

*

annunci

  • ***
  • 60 posts
Re: Change the module for entering the region and city
« Reply #3 on: October 06, 2017, 01:38:40 PM »
I solved it another way, because I changed a lot the theme and the explanation Ivanko was not good because of my changes. You can see the result here https://www.annuncigratuiti.com/item/new
« Last Edit: October 06, 2017, 01:40:21 PM by annunci »

Re: Change the module for entering the region and city
« Reply #4 on: October 08, 2017, 09:45:49 PM »
I solved it another way, because I changed a lot the theme and the explanation Ivanko was not good because of my changes. You can see the result here https://www.annuncigratuiti.com/item/new

i like it like that how can you teach me  how to do something like that please   
i want something like that
please you can screenshot the code plesase

*

annunci

  • ***
  • 60 posts
Re: Change the module for entering the region and city
« Reply #5 on: October 08, 2017, 10:31:42 PM »
I solved it another way, because I changed a lot the theme and the explanation Ivanko was not good because of my changes. You can see the result here https://www.annuncigratuiti.com/item/new

i like it like that how can you teach me  how to do something like that please   
i want something like that
please you can screenshot the code plesase

It's my work man, i'm developer, i no screen that for free...

Re: Change the module for entering the region and city
« Reply #6 on: October 08, 2017, 11:14:01 PM »
I solved it another way, because I changed a lot the theme and the explanation Ivanko was not good because of my changes. You can see the result here https://www.annuncigratuiti.com/item/new

i like it like that how can you teach me  how to do something like that please   
i want something like that
please you can screenshot the code plesase

It's my work man, i'm developer, i no screen that for free...
okay what did you want me to do

*

ayoub7450

  • **
  • 12 posts
Re: Change the module for entering the region and city
« Reply #7 on: October 09, 2017, 02:15:26 PM »
In item-post for example you need to do something like:

Code: [Select]
<div id="" style="">
<?php $prepare['i_country'] = ItemForm::country_select( ) ; ?>
</div>
<div class="list">
<label for="term"><?php _e('Location''core'); ?></label>
<?php $prepare['i_region'] =ItemForm::region_select(osc_get_regions(osc_user_country_code()), osc_user()) ;?>
</div>                         
<label for="term"><?php _e('Location''core'); ?></label>
<div class="row" >
<?php $prepare['s_city']  =  ItemForm::city_select(osc_get_cities(osc_user_region_id()), osc_user()) ;?>
</div>

in the end of item.post before footer.php add
Code: [Select]
<?php ItemForm::location_javascript(); ?>
Then you can get something like on screenshot, also same story need to do in item-edit.php

more explanation here :
https://doc.osclass.org/Changing_between_drop-down_and_autocomplete_for_locations
how we can do like this bro can you tell me more