kitsuperstore Posted August 23, 2017 Share Posted August 23, 2017 My 1.6 shop keeps getting customers checking out with Alabama as their state. Alabama is the default in the state drop down box and if they do not select the state to change it it does not give an error, it just creates the account as Alabama and then we have to contact them for their address. Does anyone know how to change the default in the state drop down to be empty or instruct customer to Select State? Thanks! Link to comment Share on other sites More sharing options...
Scully Posted August 23, 2017 Share Posted August 23, 2017 A "choose your country" would preferred imho. Which shop version do you have in use? Link to comment Share on other sites More sharing options...
kitsuperstore Posted August 23, 2017 Author Share Posted August 23, 2017 thanks for helping! i use 1.6.1.12 the country default is set to United States. i found in admin where you can set that one but it will not let me set state in the same way. it sure would be convenient if it did i'm guessing i will have to code this in somewhere. the only other thought i had to try is put a state starting with letter A and write something in there but it wont look right. Link to comment Share on other sites More sharing options...
Scully Posted August 23, 2017 Share Posted August 23, 2017 (edited) We have this code in address.tpl: {if $field_name eq 'State:name'} {assign var="stateExist" value=true} <div class="required id_state form-group"> <label for="id_state">{l s='State'} <sup>*</sup></label> <select name="id_state" id="id_state" class="form-control"> <option value="">-</option> </select> </div> {/if} Note the following line <option value="">-</option> I have in mind we added this for the exact mentionned reason. A slash would be the first selected value, since it's not valid, an error would occur when not choosing a valid state. Report back. Edited August 23, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
kitsuperstore Posted August 23, 2017 Author Share Posted August 23, 2017 hmm, my code is slightly different there. i do have the same option value line but it is not showing up first, it shows Alabama. here is my code there: {if $field_name eq 'State:name'} {assign var="stateExist" value=true} <div class="required id_state form-group"> <label class="control-label col-sm-4" for="id_state">{l s='State'} <sup>*</sup></label> <div class="col-sm-6"> <select name="id_state" id="id_state" class="form-control"> <option value="">-</option> </select> </div> </div> {/if} Link to comment Share on other sites More sharing options...
Scully Posted August 23, 2017 Share Posted August 23, 2017 (edited) Is Alabama the first in ascending order or is it the state your are located? And can you post the pice of source from your browser which shows it? Edited August 23, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
kitsuperstore Posted August 23, 2017 Author Share Posted August 23, 2017 Alabama is the first in alphabetical order. For some reason i cannot post a screenshot here. it is kitsuperstore.com. thanks! Link to comment Share on other sites More sharing options...
Scully Posted August 23, 2017 Share Posted August 23, 2017 (edited) Just created an account and looked at add first address. State is - Country is: United states Everything fine with normal address form. BUT: When it comes to checkout, you don't have prestashop default, instead I guess you have setup a custom checkout module. You should have notead this in your intial post. We cannot guess the setup. Check the tpl code of this module. You have the code above, you can use it the same way. Edited August 23, 2017 by Scully (see edit history) Link to comment Share on other sites More sharing options...
kitsuperstore Posted August 23, 2017 Author Share Posted August 23, 2017 thanks for your reply. sorry the company that built the site must have done a custom checkout. are you saying i can overwrite that snip of code with your code? Link to comment Share on other sites More sharing options...
Scully Posted August 23, 2017 Share Posted August 23, 2017 Yes you can, as long as you have found the piece of tpl where the old code is. 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