View Single Post
  #13  
Old 09-28-2005, 08:33 PM
 
tracey_ccishop tracey_ccishop is offline
 

Advanced Member
  
Join Date: Aug 2005
Posts: 55
 

Default

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.
__________________
Thanks,
www.ccishop.com
X-Cart Gold v4.0.14
Reply With Quote