![]() |
country before state
Is it possible to move the country field above the state field when a customer is checking out ?
I've had quite a few emails from customers not figuring out they need to change the country first in order to enter their province. I tried removing all the states which would be fine but we use flat rate shipping depending on state so removing all the states really isn't an option. Any help would be great, thanks :) |
Sure, just edit the main/register_billing_address.tpl and main/register_shipping_address.tpl and move the fields around however you would like.
|
Quote:
Thanks for your reply balinor, I did that but it wouldn't work for me, seems that county, state and country all tie into one another somehow. Could you be a bit more specific maybe I did something wrong? I've done quite a bit of moding on this site and am usually able to resolve the issue but this one has me stumped. BTW, I have Jon's easy checkout installed on this too but that shouldn't be an issue as the mod doesn't affect the registration form. |
There are a lot of {if} statements in there, so you have to be careful, but it is possible to move them. Did you try moving them and you got an error?
|
yes I did and I believe one of the {/if} is exactly what I screwed up, this is what I did.
Code:
{* $Id: register_billing_address.tpl,v 1.15.2.3 2004/10/26 13:08:43 max Exp $ *} I just moved country right above state but I know thats wrong. too many d*mn {if}'s and {/if}'s .... guess I'm getting old :) |
I think you need to take the second closing {/if} from the country grouping, and move it below the last {/if} in the state grouping.......
|
You have an else and an if statement ... you'll have to decide what you want to use.
- Mike |
ok thanks balinor I'll give that a try in a little while once traffic slows down a bit.
I REALLY appreciate your help with this :) |
Quote:
sorry Mike just caught your post, can you explain further ? |
Ok I got it and it works :)
The only other thing I had to do was to also reverse the country and state fields in the register_states.tpl Works like a charm :D Thanks guys for your help .... excellent :) |
Quote:
Where does register_states.tpl get rendered? I can't find it's output in the checkout process. The state before country thing is amazingly poor design, as is the requirement to enter names repeatedly :evil: I've got to get the checkout form reformed. Any advise would be cherished :? |
please explain more
cybrgman
can you please explain this a little better for me :oops: ? Does this move the country before the state in the registration form? Quote:
can you show your file so that I can ensure mine is correct. |
I also had a similar issue and got this code back from tech support. It changes the customer registration form so that the user has to enter the country they are in first and then a drop down box appears with the list of states for that country.
Hope it helps Please perform following steps: > > 1. Open '<xcart_root_dir>/skin1/main/register_states.tpl' template. > > 2. Replace : > > --- > <SELECT name="{$country_name}" id="{$country_name}" > onChange="check_zip_code_field(document.forms['{$form_name}'].{$country_n > ame}, document.forms['{$form_name}'].{$zipcode_name}); > change_states(document.getElementById('{$country_n ame}'), > '{$state_name}', '{$county_name}', '{$lng.lbl_state|replace:"'":"\'"}', > '{$state|replace:"'":"\'"}', '{$is_no_input}', > '{$full_state|replace:"'":"\'"}', > '','{$userinfo.$county_name|replace:"'":"\'"}','{$ userinfo.$county_name|r > eplace:"'":"\'"}'); change_counties('{$county_name}', > document.getElementById('_{$state_name}'), > document.getElementById('{$country_name}'), > '{$userinfo.$county_name}','{$userinfo.$county_nam e}');"> > {foreach from=$countries item=v} > <OPTION value="{$v.country_code}"{if $country eq $v.country_code} > selected{elseif $v.country_code eq $config.General.default_country and > $country eq ""}selected{/if}>{$v.country}</OPTION> > {/foreach} > </SELECT> > --- > > with > > --- > <SELECT name="{$country_name}" id="{$country_name}" > onChange="check_zip_code_field(document.forms['{$form_name}'].{$country_n > ame}, document.forms['{$form_name}'].{$zipcode_name}); > change_states(document.getElementById('{$country_n ame}'), > '{$state_name}', '{$county_name}', '{$lng.lbl_state|replace:"'":"\'"}', > '{$state|replace:"'":"\'"}', '{$is_no_input}', > '{$full_state|replace:"'":"\'"}', > '','{$userinfo.$county_name|replace:"'":"\'"}','{$ userinfo.$county_name|r > eplace:"'":"\'"}'); change_counties('{$county_name}', > document.getElementById('_{$state_name}'), > document.getElementById('{$country_name}'), > '{$userinfo.$county_name}','{$userinfo.$county_nam e}');"> > <OPTION value="" selected>Please select country...</OPTION> > > {foreach from=$countries item=v} > <OPTION value="{$v.country_code}"{if $country eq $v.country_code} > selected{/if}>{$v.country}</OPTION> > {/foreach} > </SELECT> > --- > > After that your customers will see 'Please select country...' option in > 'Country' drop-down box first. |
Re: country before state
This seems to have changed in version 4.1. Any ideas how I might implement this little mod?
Thanks! |
All times are GMT -8. The time now is 10:49 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.