X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Problems with State field on registration form (https://forum.x-cart.com/showthread.php?t=14709)

frankdux 06-21-2005 10:32 AM

Problems with State field on registration form
 
I am running into a problem with the "State" field on the registration form when users have JavaScript disabled. If a user has JavaScript turned off in their browser they cannot see this field at all and thus they cannot enter anything. The end result is that whatever your default state is set to is what shows up as the state in the order confirmation email. The order may going to a zip code in Oregon but it will show New York as the state.

Now someone's first response might be to say that the user can click on the "If Javascript is disabled in your browser click here" link. The problem is, a lot of people have no idea what JavaScript is so they don't know to use that link.

Here is a screenshot that shows the state field missing:
http://www.zaptank.com/temp/js_missing_state.jpg

Has anyone else bumped into this problem and come up with a good way to handle it?

balinor 06-21-2005 12:40 PM

You could just turn of the Javascript generated state list and have them enter their state manually.

frankdux 06-22-2005 06:38 AM

Quote:

Originally Posted by balinor
You could just turn of the Javascript generated state list and have them enter their state manually.


I considered that, but I thought it would cause problems because people would enter the state inconsistently. For example Florida could be entered as FL, FLA or Florida. I might be wrong, but I was worried that my payment gateway(VeriSign Payflow Pro) or FedEx might choke on that. Actually with FedEx it's just going by the zip so I guess my only concern is with the payment gateway.

frankdux 06-28-2005 12:30 PM

Well I am starting to think this problem has a different origination than users having Javascript turned off. Based on some testing I've been doing, I am starting to think my customers are just forgetting to choose a state and leaving the default state. What might help with this is a choice at the top of the Select Form saying "Select A State." I am normally pretty capable of customizing X-cart, but because the state list is generated dynamically I cannot figure out a way to insert something like. Anyone ever do something like this or have any idea how to do it? If I didn't explain this clearly, here is a screenshot of what I am trying to do:

http://www.zaptank.com/temp/select_a_state.jpg

frankdux 07-05-2005 09:52 AM

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}
}



All times are GMT -8. The time now is 11:14 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.