Forums / Bug Reports / $flag_show_pulldown_states set to true

$flag_show_pulldown_states set to true

Locked

Views: 2,095

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
12 Oct 2008, 7:59 PM
#1
doug949 avatar

doug949

New Zenner

Join Date:
Sep 2008
Posts:
15
Plugin Contributions:
0

$flag_show_pulldown_states set to true

Greetings,

The following relates to ZenCart version 1.3.8a.

I believe I found a small bug in modules/create_account.php near the bottom at about line 440.

My system is configured with Configure->Customer Details->State Always Display as pulldown set to false

and

Configure->Customer Details->State set to true

My interpretation of the above it that my store front should never display a pull down menu for states. However, I found it does when someone is setting up a new account and does not enter anything in the state box. The next screen shows a state pulldown and input text box for state. This behavior also happens even though I select a country like Antarctica which has no state zones set up in the configuration.

In troubleshooting the issue, I found that the following line in modules/create_account.php (near the bottom at about line 440) is not setting value of $flag_show_pulldown_states to false. When I replace the line with $flag_show_pulldown_states = false;
everything works fine. Of course this is not an ideal solution as if I later want to re-configure system to show the state pulldown I have to remember I made this change and then reverse it. In any case, here is what I think is the offending line of code:

$flag_show_pulldown_states = ((($process == true || $entry_state_has_zones == true) && $zone_name == '') || ACCOUNT_STATE_DRAW_INITIAL_DROPDOWN == 'true' || $error_state_input) ? true : false;

12 Oct 2008, 8:08 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: $flag_show_pulldown_states set to true

It's not a bug. It's intended behavior. In the case where the customer cannot correctly type a valid entry, the pulldown appears to allow them to quickly choose a valid option. The Always Display Pulldown switch specifically affects the first visit to the page.

If that's not the desired behavior for you and your customers, you're certainly free to make changes to the code similar to what you posted above.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.