Page 2 of 8 FirstFirst 1234 ... LastLast
Results 11 to 20 of 79
  1. #11
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

    Default Re: Reproducible bug with state selection check on registration

    Sorry to be so long getting back to this but company tasks outrank free work.

    I got back to this a few minutes ago and found a possible solution, it seems to work here but your results may vary so I make no guarantees that it will fix the problems with other countrys etc., but it does seem to fix the dead end situation a user gets into if they initially forget to select a state during account creation.

    Here is the change:

    In the file includes/modules/pages/create_account/jscript_form_check.php

    Locate the line which reads:

    Code:
    <?php if (ACCOUNT_STATE == 'true') echo '  if (!form.state.disabled && form.zone_id.value > 0) check_input("state", ' . ENTRY_STATE_MIN_LENGTH . ', "' . ENTRY_STATE_ERROR . '") . "\n";?>
    and change it to read:

    Code:
    <?php if (ACCOUNT_STATE == 'true') echo '  if (!form.state.disabled && form.zone_id.value > 0) check_input("state", ' . ENTRY_STATE_MIN_LENGTH . ', "' . ENTRY_STATE_ERROR . '")  form.state.disabled="disabled";' . "\n";?>
    Let me know if this works and if so how well?

    Thanks,
    Jeff

  2. #12
    Join Date
    Jan 2004
    Location
    UK
    Posts
    1,230
    Plugin Contributions
    0

    Default Re: Reproducible bug with state selection check on registration

    Thanks Jeff,

    Just tried your fix on 1.3.5 (with states pulldown = false, and leaving the states field empty when clicking 'submit')

    it does seem to overcome the problem of having to type the state into the second states box (which still shows after the error message) after selecting a state from the pull-down in order to create an account.

    Part of the problem though, of course, is that the second state field *does* appear once the states pull-down is activated (either through 'states pull-down = true', or through a user error on create account).

    Something which doesn't seem to have been mentioned so far (at least in the bugs forum) is that the problem also appears to extend to the address book (adding/editing an address) and to changing a billing/shipping address during checkout.

  3. #13
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

    Default Re: Reproducible bug with state selection check on registration

    Hi Pixxi,

    We use the 'states pull-down = true' configuration so my fix was just to get that functionality to work correctly however your comment about how this is all supposed to work begs further explanation.

    As I understand the new states "mechanism" design, the States/Province text field is *always* supposed to be visible regardless of the states pull-down configuration, at least it is for us. Based on the country selected and whether there are zones associated with the selected country, the zones (States/Province) popup menu's first and default choice is set to: "Please select..." indicating to the customer is to select a choice from the zones (States/Province) menu. If the default country in your configuration has zones associated the (States/Province) text field is disabled (*but still visible*) and will not permit text entry.

    If a country is selected that has no zones associated with it, as in the case of 'Antartica', the the zones (States/Province) popup menu's default and only choice is set to: "Type a choice here..." and the States/Province text field is enabled and will permit text entry.

    This all seems like the correct behavior to me at least and with the suggested change now works fine here in all cases when the default country is the 'United States' using the 'states pull-down = true' configuration. I am wondering though after your explanation if you are seeing a different behavior as we are? You might consider taking a look at our site create account functionality and commenting if your site behaves the same? I am interested if after adding this code change others using different states pull-down configuration and/or other default country can comment on their success/failure, and where problems still exist, if they do?

    Thanks,
    Jeff

  4. #14
    Join Date
    Jan 2004
    Location
    UK
    Posts
    1,230
    Plugin Contributions
    0

    Default Re: Reproducible bug with state selection check on registration

    Ahh ... I was assuming that the text edit box should only appear if no zones existed for the country selected - otherwise (my thinking was) it could be confusing for a customer having a text-entry box that they can't type into/doesn't have a label (and what's more, it spoils the symmetery of the page )

    But looked at from that perspective, it does now seem to be working - so well done, and thanks

    / dashes off to see if that second box *can* be disabled until needed ...

  5. #15
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

    Default Re: Reproducible bug with state selection check on registration

    Hi Pixxi,

    I agree it *should* behave the way you describe. I really don't think it would be too hard to modify the code to hide the field when there exists zones for the selected country and show it when there are none. We are actually using some javascript code to do a very similar thing (hide or show form fields based on a popup menu form selection) on another site based on the work found here. It works perfectly under both FF and IE and I believe this methodology could easily be adapted to this situation. I'll probably take a stab it it on Monday when I return to work.

    Thanks for your feedback!

    Jeff

  6. #16
    Join Date
    Jan 2004
    Posts
    66,442
    Plugin Contributions
    279

    Default Re: Reproducible bug with state selection check on registration

    The official bug-fix is in testing phase now. More to come ...
    .

    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.

  7. #17
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

    Default Re: Reproducible bug with state selection check on registration

    That's great Dr. Byte, I will refrain from doing any further work for now then!

    Is the official bug fix going to hide the state field when it is not required?

    Thanks,
    Jeff

  8. #18
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

    Default Re: Reproducible bug with state selection check on registration

    Pixxi,

    Just an FYI... I typoed the fix line, it should have read:

    Code:
    <?php if (ACCOUNT_STATE == 'true') echo '  if (!form.state.disabled && form.zone_id.value > 0) check_input("state", ' . ENTRY_STATE_MIN_LENGTH . ', "' . ENTRY_STATE_ERROR . '");  form.state.disabled="disabled";' . "\n";?>
    It was missing a ";" terminator otherwise the jscript has an error which causes it to fail. Sorry!
    There are 6 places in the code that require the change.

    Jeff

  9. #19
    Join Date
    Jan 2004
    Location
    UK
    Posts
    1,230
    Plugin Contributions
    0

    Default Re: Reproducible bug with state selection check on registration

    Thanks for the correction Jeff,

    Although ...

    There are 6 places in the code that require the change.
    is a bit puzzling

  10. #20
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

    Default Re: Reproducible bug with state selection check on registration

    Hi Pixxi,

    You should actually have only 5 places, assuming you added this fix to the following files that require it:

    includes/modules/pages/address_book_process/jscript_main.php
    includes/modules/pages/checkout_payment_address/jscript_main.php
    includes/modules/pages/checkout_shipping_address/jscript_main.php
    includes/modules/pages/create_account/jscript_form_check.php
    includes/modules/pages/login/jscript_form_check.php

    I have one additional (special) account creation form so I had six.

    Jeff

 

 
Page 2 of 8 FirstFirst 1234 ... LastLast

Similar Threads

  1. v139d Problem with customer registration - State field
    By OnlySeaDoo in forum Managing Customers and Orders
    Replies: 11
    Last Post: 3 Oct 2012, 09:33 AM
  2. Replies: 1
    Last Post: 22 Nov 2011, 06:16 AM
  3. [Done v1.3.9] Newsletter Sign up Check Box Bug
    By StoneColdMagic in forum Bug Reports
    Replies: 2
    Last Post: 14 Jul 2009, 03:17 AM
  4. Replies: 1
    Last Post: 1 Jun 2007, 02:13 AM
  5. [Done v1.3.7] State Selection in Shipping Estimator
    By Woodymon in forum Bug Reports
    Replies: 4
    Last Post: 30 Dec 2006, 12:12 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg