sooroos Posted November 22, 2013 Share Posted November 22, 2013 Hi, I need the zip code field in OPC to be displayed as a dropdownlist and choosable from 10-20 specific codes. Just let me know if you there is any expert interested. If yes, pm me the time needed and the desired price. Link to comment Share on other sites More sharing options...
bellini13 Posted November 22, 2013 Share Posted November 22, 2013 Just OPC? There are several other front and back office pages where zip code is displayed and can be changed. Link to comment Share on other sites More sharing options...
sooroos Posted November 22, 2013 Author Share Posted November 22, 2013 the thing is that i have an online pizza shop (check it here) and i deliver just in the nearby area. (10-20 different zip codes, Germany) I need these zip codes to work in OPC and user registration process . I dont really know what involves this, but i need only the customers in the area to order and register Link to comment Share on other sites More sharing options...
bellini13 Posted November 22, 2013 Share Posted November 22, 2013 And I am simply pointing out that there are other areas in Prestashop that one can alter the zip code (outside of OPC/registration), including the My Account Addresses section. Would you like to leave those alone and just focus on OPC? Since these are your requirements, you need to educate your self on how your store works, and then base your requirements around that. Link to comment Share on other sites More sharing options...
sooroos Posted November 22, 2013 Author Share Posted November 22, 2013 i would like to focus first on opc and see how does it works, especially because my clients prefer not to register, i have 130 costumers but only 2 have account registered Link to comment Share on other sites More sharing options...
bellini13 Posted November 22, 2013 Share Posted November 22, 2013 Ok, I will send you a PM Link to comment Share on other sites More sharing options...
Rolige Posted November 22, 2013 Share Posted November 22, 2013 Hi sooroos, Here the free solution that i have mentioned by PM. Open the file: themes\your_active_theme\authentication.tpl Locate (there are 2 coincidence): <input type="text" class="text" name="postcode" id="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{/if}" onblur="$('#postcode').val($('#postcode').val().toUpperCase());" /> Replace the 2 coincidence by: <select id="postcode" name="postcode"> <option value="">-</option> <option value="80000">81400</option> <option value="80001">81401</option> <option value="80002">81401</option> <option value="80003">81401</option> </select> NOTE: Here you can add all default zip codes as you need, this is only an example. Repeat this in the file: themes\your_active_theme\address.tpl Locate (there are 2 coincidence): <input type="text" id="postcode" name="postcode" value="{if isset($smarty.post.postcode)}{$smarty.post.postcode}{else}{if isset($address->postcode)}{$address->postcode|escape:'html'}{/if}{/if}" onkeyup="$('#postcode').val($('#postcode').val().toUpperCase());" /> Replace the 2 coincidence by: <select id="postcode" name="postcode"> <option value="">-</option> <option value="80000">81400</option> <option value="80001">81401</option> <option value="80002">81401</option> <option value="80003">81401</option> </select> Force compile and let me know if works. Regards. Link to comment Share on other sites More sharing options...
sooroos Posted November 22, 2013 Author Share Posted November 22, 2013 COTOKO, your solution works partially the zipcode appears as dropdownlist indeed but in backoffice the customer appear with a different code as the selected one Link to comment Share on other sites More sharing options...
Rolige Posted November 23, 2013 Share Posted November 23, 2013 COTOKO, your solution works partially the zipcode appears as dropdownlist indeed but in backoffice the customer appear with a different code as the selected one This solution is only for the Front Office, if you change the 4 blocks of code (2 in authentication.tpl and 2 in address.tpl) works perfectly, in the Back Office you will see the zip code selected by customer but here will appear without dropdown list, i have tested and works perfectly. Link to comment Share on other sites More sharing options...
al404 Posted March 1, 2021 Share Posted March 1, 2021 Hi does any one know where it was moved in prestashop 1.7? 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