ananthgurunathan Posted February 24, 2014 Share Posted February 24, 2014 Hi there, I want to make the city field in Registeration page to a Drop down menu with some cities that i want. Because I just want to sell my products in that cities only. So, hope someone will reply for my requirement. Thanks in Advance, Ananth.G Link to comment Share on other sites More sharing options...
NemoPS Posted February 24, 2014 Share Posted February 24, 2014 Please avoid creating duplicate threads you can edit address.tpl, or order-opc-new-account.tpl if yo uuse that. FInd the field, replace the input type="test" with a select and hardcode your custom values by naming the field as the previous input (same name="....") 3 Link to comment Share on other sites More sharing options...
vekia Posted February 24, 2014 Share Posted February 24, 2014 also modify authentication.tpl because there is city field too {elseif $field_name eq "city"} <p class="required text"> <label for="city">{l s='City'} <sup>*</sup></label> <input type="text" class="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{/if}" /> </p> 1 Link to comment Share on other sites More sharing options...
ananthgurunathan Posted February 24, 2014 Author Share Posted February 24, 2014 also modify authentication.tpl because there is city field too {elseif $field_name eq "city"} <p class="required text"> <label for="city">{l s='City'} <sup>*</sup></label> <input type="text" class="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{/if}" /> </p> Thanks.... Nemo1 & Vikia for your Valueable help,.... I have change the files as per your guidence... its working perfectly... Thanks a lot again... Link to comment Share on other sites More sharing options...
mol1111 Posted March 5, 2014 Share Posted March 5, 2014 Hi, I'm also trying to create a drop down menu for cities, but I don't get to fill this menu with the different cities. it's empty. I don't know how to set the content of this drop down menu depending on the selected country. the used code is the following: <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> BTW: I modified either address.tpl or authentication.tpl, but I just get a empty drop down menu Thanks in advance!! 1 Link to comment Share on other sites More sharing options...
vekia Posted March 5, 2014 Share Posted March 5, 2014 how many countries you've got active? Link to comment Share on other sites More sharing options...
mol1111 Posted March 5, 2014 Share Posted March 5, 2014 Just one, concretly Spain. My goal is to get the next structure: - Country - City - Town Of this way, When I select a country (only Spain), the drop down for 'City' is filled with the cities of Spain. And when a city is selected, the drop down for 'Town' is filled with the towns of this city. Thanks!! 1 Link to comment Share on other sites More sharing options...
selectsoft Posted July 13, 2014 Share Posted July 13, 2014 Hi Vekia, Could you please provide the code to be replaced in both address.tpl and authentication.tpl to make city field as dropdown? I have tried to implement the above steps but left with failed. Currently we offer our services in only one city. We wanted to hardcode the same in our store. we are using PrestaShop 1.6.0.8 Thanks in advance. Link to comment Share on other sites More sharing options...
Harta Posted September 30, 2014 Share Posted September 30, 2014 Hi all, Dear all prestashop expert. I'm a beginner without any programming language background. I'm interested about how Ananth G. solved his problem? Could someone explain what should we do in our address & authetication.tpl? I've changed/modify as nemo & vekia said but the city field is still empty without dropdown menu. I wanna change city as my province, then country as my county, then state become my little town. Could someone help me please? Thanks in advance. Link to comment Share on other sites More sharing options...
dvien_h_ali Posted May 8, 2015 Share Posted May 8, 2015 Just one, concretly Spain. My goal is to get the next structure: - Country - City - Town Of this way, When I select a country (only Spain), the drop down for 'City' is filled with the cities of Spain. And when a city is selected, the drop down for 'Town' is filled with the towns of this city. Thanks!! I need the exact thing. Please can anyone give me a hint? Thanks. Link to comment Share on other sites More sharing options...
belladict Posted May 20, 2015 Share Posted May 20, 2015 I also need the above structure... Is there a module for that? Link to comment Share on other sites More sharing options...
NemoPS Posted May 22, 2015 Share Posted May 22, 2015 It's more complicated than it sounds.You'd need to add a whole new entity (say, Town), with its own class and separate database table (with an association to the country, and eventually state).Then, you'd have to modify the template as well 1 Link to comment Share on other sites More sharing options...
vicaalvarez Posted May 26, 2015 Share Posted May 26, 2015 also modify authentication.tpl because there is city field too {elseif $field_name eq "city"} <p class="required text"> <label for="city">{l s='City'} <sup>*</sup></label> <input type="text" class="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{/if}" /> </p> Greetings Vekia, thanks for your help, how can i make a city drop down that changes values with the state chosen? thhanks! Link to comment Share on other sites More sharing options...
yuvafwd Posted January 20, 2016 Share Posted January 20, 2016 Edit this file “order-opc-new-account.tpl” Search for <label for="city">{l s='City'} <sup>*</sup></label> Add red line like below Comment blue line like below ----------CODE-------------- <label for="city">{l s='City'} <sup>*</sup></label> <select name="city" id="city" class="form-control"> <option value="Udaipur">Udaipur</option> </select> {* <input type="text" class="text form-control validate" name="city" id="city" data-validate="isCityName" value="{if isset($guestInformations) && isset($guestInformations.city) && $guestInformations.city}{$guestInformations.city}{/if}" /> *} Link to comment Share on other sites More sharing options...
dvien_h_ali Posted February 23, 2016 Share Posted February 23, 2016 also modify authentication.tpl because there is city field too {elseif $field_name eq "city"} <p class="required text"> <label for="city">{l s='City'} <sup>*</sup></label> <input type="text" class="text" name="city" id="city" value="{if isset($smarty.post.city)}{$smarty.post.city}{/if}" /> </p> Why is there city field in authentication.tpl? where is that field in the front page? and there are two other city fields except the one you mentioned should I change these as well? Link to comment Share on other sites More sharing options...
oejang Posted February 25, 2016 Share Posted February 25, 2016 please explain me more detail, i am newbie. thanks before Link to comment Share on other sites More sharing options...
Cosmin T. Posted May 3, 2017 Share Posted May 3, 2017 Hi. How can i make this for Prestashop 1.7? I have more than 2500 city's... Link to comment Share on other sites More sharing options...
Recommended Posts