Jump to content

State Drop Down Default in Checkout (Alabama)


kitsuperstore

Recommended Posts

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

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

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 by Scully (see edit history)
Link to comment
Share on other sites

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

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 by Scully (see edit history)
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...