Advertisement:

Author Topic: Changing between drop-down and autocomplete for locations  (Read 4475 times)

isnoopy30

  • Newbie
  • *
  • Posts: 21
Changing between drop-down and autocomplete for locations
« on: November 23, 2013, 12:53:50 pm »
Hi every body. im trying to learn some php and im following the osclass DOCS to change somthings. in this case im triying to change the input of locations when adding an item. i would like to change the input from input text to dropdown location. i get some errors in region input:

Fatal error: Call to undefined function osc_user_country_code() in /home/u898673890/public_html/oc-content/themes/spain/item-post.php on line 149

im triyin to figure out what is missing. i dont care. im working with spain theme and the link to the web is: anuncioteka.hol.es 

ill atach 3 pics to show.


isnoopy30

  • Newbie
  • *
  • Posts: 21
Re: Changing between drop-down and autocomplete for locations
« Reply #1 on: November 23, 2013, 12:59:20 pm »
this is pic for files edited

isnoopy30

  • Newbie
  • *
  • Posts: 21
Re: Changing between drop-down and autocomplete for locations
« Reply #2 on: November 23, 2013, 01:00:44 pm »
item-post

TaMaX

  • Newbie
  • *
  • Posts: 1
Re: Changing between drop-down and autocomplete for locations
« Reply #3 on: November 25, 2013, 05:36:24 pm »
Same problem here :(

If you have only one country , you can workaround this by change :
Code: [Select]
osc_user_country_code() to:
Code: [Select]
'en_US'en_US should be your country code, for example my code for poland:
Code: [Select]
<?php ItemForm::region_select(osc_get_regions('pl_PL'), osc_user()) ; ?>

isnoopy30

  • Newbie
  • *
  • Posts: 21
Re: Changing between drop-down and autocomplete for locations
« Reply #4 on: November 25, 2013, 10:35:02 pm »
hi. first of all thank you about response.  i got the damn thing working as expected.  cause i have som deficiency on php programing. thank you another time.

carsangrah123

  • Jr. Member
  • **
  • Posts: 59
  • www.carsangrah.com
Re: Changing between drop-down and autocomplete for locations
« Reply #5 on: November 26, 2013, 06:51:15 am »
can you please share how u got this working.
Thanks.

isnoopy30

  • Newbie
  • *
  • Posts: 21
Re: Changing between drop-down and autocomplete for locations
« Reply #6 on: November 26, 2013, 05:06:11 pm »
hi. you have to follow instructions of this link: http://doc.osclass.org/Changing_between_drop-down_and_autocomplete_for_locations
and in the file item-post.php  you have to change :

osc_user_country_code()  by  the country code you having.

change this sentence : ?php ItemForm::region_select(osc_get_regions(osc_user_country_code()), osc_user()) ; ?>

to: <?php ItemForm::region_select(osc_get_regions('es_ES'), osc_user()) ; ?>

i have spain country installed so you have to change the code  ('es_ES') to your relativee country.


carsangrah123

  • Jr. Member
  • **
  • Posts: 59
  • www.carsangrah.com
Re: Changing between drop-down and autocomplete for locations
« Reply #7 on: November 27, 2013, 11:04:51 am »
Thanks a lot.

hi. you have to follow instructions of this link: http://doc.osclass.org/Changing_between_drop-down_and_autocomplete_for_locations
and in the file item-post.php  you have to change :

osc_user_country_code()  by  the country code you having.

change this sentence : ?php ItemForm::region_select(osc_get_regions(osc_user_country_code()), osc_user()) ; ?>

to: <?php ItemForm::region_select(osc_get_regions('es_ES'), osc_user()) ; ?>

i have spain country installed so you have to change the code  ('es_ES') to your relativee country.

carsangrah123

  • Jr. Member
  • **
  • Posts: 59
  • www.carsangrah.com
Re: Changing between drop-down and autocomplete for locations
« Reply #8 on: November 27, 2013, 01:44:44 pm »
I tried as you suggested. But I couldn't solve it yet.
Please help me
How did u find you country code es_ES? I tried en_IN for india. Its not working.


hi. you have to follow instructions of this link: http://doc.osclass.org/Changing_between_drop-down_and_autocomplete_for_locations
and in the file item-post.php  you have to change :

osc_user_country_code()  by  the country code you having.

change this sentence : ?php ItemForm::region_select(osc_get_regions(osc_user_country_code()), osc_user()) ; ?>

to: <?php ItemForm::region_select(osc_get_regions('es_ES'), osc_user()) ; ?>

i have spain country installed so you have to change the code  ('es_ES') to your relativee country.



isnoopy30

  • Newbie
  • *
  • Posts: 21
Re: Changing between drop-down and autocomplete for locations
« Reply #9 on: November 27, 2013, 05:22:40 pm »
hi. im not sure abou india code. make a research in the web.   i do made research for india code in this link : http://snipplr.com/view/36868/

it shows : IN -----    may be its    (in_IN)  . try it and tell me. bye.