abdulcrb Posted January 1, 2017 Share Posted January 1, 2017 Hi, Can someone help me, I'm new in Prestashop. I use Prestashop 1.7.0.3 . I want to customize page address customer with dropdown from my data. how to change it? what file I must configure/edit? Thx Link to comment Share on other sites More sharing options...
hasan197 Posted January 6, 2017 Share Posted January 6, 2017 (edited) I'm facing same problem. My first attempt is edit file address-form.tpl by adding below condition {if $field["name"] eq "city"} <p class="required city select"> <label for="city">{l s='City'} <sup>*</sup></label> <select name="city" id="id_city"> <option value="">-3</option> </select> </p> Edited January 6, 2017 by hasan197 (see edit history) Link to comment Share on other sites More sharing options...
abdulcrb Posted January 10, 2017 Author Share Posted January 10, 2017 I'm facing same problem. My first attempt is edit file address-form.tpl by adding below condition {if $field["name"] eq "city"} <p class="required city select"> <label for="city">{l s='City'} <sup>*</sup></label> <select name="city" id="id_city"> <option value="">-3</option> </select> </p> This Problem Solve , I Edit Classes CustomerAddressFormatter.php and edit function getFormat, I use City get from external api rajaongkirapi Link to comment Share on other sites More sharing options...
batamkt Posted February 6, 2018 Share Posted February 6, 2018 (edited) On 10/1/2017 at 1:58 PM, abdulcrb said: This Problem Solve , I Edit Classes CustomerAddressFormatter.php and edit function getFormat, I use City get from external api rajaongkirapi Hello, could you go into more detail on how you did this? Edited February 6, 2018 by batamkt (see edit history) Link to comment Share on other sites More sharing options...
Evgenii Pavlov Posted March 25, 2018 Share Posted March 25, 2018 up Link to comment Share on other sites More sharing options...
rizkyprogrammer Posted April 8, 2018 Share Posted April 8, 2018 You can check this my article for create dropdown with rajaongkir API for city of indonesia, https://aidil.web.id/2018/04/08/prestashop-1-7-rajaongkir-city-dropdown/ Link to comment Share on other sites More sharing options...
Evgenii Pavlov Posted April 8, 2018 Share Posted April 8, 2018 9 hours ago, rizkyprogrammer said: You can check this my article for create dropdown with rajaongkir API for city of indonesia, https://aidil.web.id/2018/04/08/prestashop-1-7-rajaongkir-city-dropdown/ awesome work, thx my RU example foreach ($fields as $field) { $formField = new FormField(); $formField->setName($field); $fieldParts = explode(':', $field, 2); if ($field === 'city') { $url='http://api.boxberry.de/json.php?token=XXXX.YYYY&method=ListCitiesFull'; $handle = fopen($url, "rb"); $contents = stream_get_contents($handle); fclose($handle); $data=json_decode($contents,true); if(count($data)<=0 or $data[0]['err']) { error_log('Ошибка получения городов! '.$data[0]['err'], 0); } else { $formField->setType('select'); foreach ($data as $obj) { $citys_array[] = $obj['Name']; } sort($citys_array); array_unshift($citys_array, 'Санкт-Петербург'); array_unshift($citys_array, 'Москва'); $final = array_unique($citys_array); foreach ($final as $city) { $formField->addAvailableValue( $city, $city ); } } } Link to comment Share on other sites More sharing options...
dandumit Posted July 2, 2019 Share Posted July 2, 2019 On 4/8/2018 at 2:16 PM, rizkyprogrammer said: You can check this my article for create dropdown with rajaongkir API for city of indonesia, https://aidil.web.id/2018/04/08/prestashop-1-7-rajaongkir-city-dropdown/ @rizkyprogrammer could you please put back your article ? Doesn't load .. Thank you, Daniel Link to comment Share on other sites More sharing options...
dandumit Posted July 2, 2019 Share Posted July 2, 2019 On 4/9/2018 at 12:02 AM, Evgenii Pavlov said: $url='http://api.boxberry.de/json.php?token=XXXX.YYYY&method=ListCitiesFull'; $handle = fopen($url, "rb"); Evgenii Pavlov - your application load all list of cities ? not only the ones related to respective county ? I can't see you sending the parameter for county... Thank you, Daniel Link to comment Share on other sites More sharing options...
rezvan Posted April 17, 2020 Share Posted April 17, 2020 I use prestashop 1.7.6.4 and i want support just tow city for my shop Do you have a suggestion to make a drop-down city on address page? Link to comment Share on other sites More sharing options...
Mr. Trice Posted January 5, 2021 Share Posted January 5, 2021 This will be a long process for layman. I have a complete module that solve this for you. Both on city and zip code drop-down. And it will display everywhere an address is found. It also have a feature to allow customers to add their city and zip code if is not listed. Well, you can disable the feature if you don't want the customer to add their own city and zip code. I will send the link here if you want or can message me if you want too. Works perfectly fine. Link to comment Share on other sites More sharing options...
num47 Posted April 19, 2021 Share Posted April 19, 2021 On 1/5/2021 at 5:23 PM, Mr. Trice said: This will be a long process for layman. I have a complete module that solve this for you. Both on city and zip code drop-down. And it will display everywhere an address is found. It also have a feature to allow customers to add their city and zip code if is not listed. Well, you can disable the feature if you don't want the customer to add their own city and zip code. I will send the link here if you want or can message me if you want too. Works perfectly fine. May i get the Module, Please. Sounds a good Module. Link to comment Share on other sites More sharing options...
Mr. Trice Posted May 3, 2021 Share Posted May 3, 2021 On 4/19/2021 at 9:23 PM, num47 said: May i get the Module, Please. Sounds a good Module. Contact faddons.com, that's my team mates. Or you can chat me personally on whatsapp +2347039732276 The module is cheap to get. Link to comment Share on other sites More sharing options...
Mr. Trice Posted July 26, 2021 Share Posted July 26, 2021 On 4/19/2021 at 9:23 PM, num47 said: May i get the Module, Please. Sounds a good Module. You can checkout the demo here> Backoffice = https://demo.faddons.com/prestashop/admin914gpvxwo email: [email protected] pass: demodemo the module is hooked under international menu Front office = https://demo.faddons.com the module also has a function to add a text to display at the front office incase you want the customer to add his/her own city and zipcode if not listed. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now