View Single Post
  #5  
Old 07-05-2005, 09:52 AM
  frankdux's Avatar 
frankdux frankdux is offline
 

Senior Member
  
Join Date: Jul 2004
Location: Manchester, NH, USA
Posts: 125
 

Default

Ok, with the help of X-cart support, I was able to to find a way to insert "Select A State" at the top of the State form. This prevents people from just leaving the default state chosen. The default now is "Select A State" and they will get an error now if they don't choose anything. I am posting the modification here for anyone else who may want to use it.

1. Open '<xcart_root_dir>/skin1/change_states_js.tpl' template.

2. Make a backup copy of '<xcart_root_dir>/skin1/change_states_js.tpl' in case this change breaks something. I did this on a store using X-Cart 4.0.11.

3. Replace :
Code:
for(x = 0; x < _states.length; x++) { s_obj.options[s_obj.length] = new Option(states[_states[x]][2], states[_states[x]][1]); s_obj.options[s_obj.length-1].selected = (default_value == states[_states[x]][1]); }

with:
Code:
s_obj.options[s_obj.length] = new Option("Select A State", ""); s_obj.options[s_obj.length-1].selected = true; for(x = 0; x < _states.length; x++) { s_obj.options[s_obj.length] = new Option(states[_states[x]][2], states[_states[x]][1]); {/literal} {if $login ne ""} s_obj.options[s_obj.length-1].selected = (default_value == states[_states[x]][1]); {/if} {literal} }
__________________
X-Cart: 4.0.18
Linux, Apache, MySQL: 4.1.16, PHP: 4.4.2
Reply With Quote