Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Feb 2011
    Posts
    43
    Plugin Contributions
    0

    Default Problem with customer registration - State field

    I have a problem with customer registration so have been living with it so far but would like to fix. In "Customer Details" I have the State set to TRUE and "Always Display As Pulldown" also set to TRUE. By my thinking I should just have a pulldown with states but what it does is first makes you type in your state then when you submit, gives you an error and makes you use the pulldown that doesn't function the first time. Is that how it's supposed to function?

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Problem with customer registration - State field


  3. #3
    Join Date
    Feb 2011
    Posts
    43
    Plugin Contributions
    0

    Default Re: Problem with customer registration - State field

    Thanks I put the following at the end of the stylesheet.css

    .hiddenField {
    display: none;
    }
    .visibleField {
    display: inline;
    }

    That didn't do anything though. Note when you get to the reg page the first time I don't have a state drop down. If you click where it should be, it says "type a choice below". Once you type a choice and submit, it gives you the error and shows the pulldown. I think the pulldown should be showing the first time correct?

  4. #4
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,024
    Plugin Contributions
    3

    Default Re: Problem with customer registration - State field

    The dropdown should show all the time. Post a URL and we can take a look.

  5. #5
    Join Date
    Feb 2011
    Posts
    43
    Plugin Contributions
    0

    Default Re: Problem with customer registration - State field

    If you place an order on www.osdparts.com (pick anything) then go to the cart and try and register, you should be able to see what I mean.

  6. #6
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Problem with customer registration - State field

    Pick United States and then it will go away ...

    Prior to that, it does not know if it needs a manual or dropdown state ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today: v1.5.5]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  7. #7
    Join Date
    Mar 2011
    Location
    In a green and pleasant land
    Posts
    46
    Plugin Contributions
    0

    Default Re: Problem with customer registration - State field

    Hi Linda
    I still have this problem
    I am in the UK and it won't accept any typed counties
    Every tine one of my customers sets up an account it allows them to type their county name (shouldn't be state if the country is United Kingdom - but that's just a xenophobic niggle). When they save their count it comes back with a drop down of countries
    There is something not right
    I'm using 1.39h

    My website is www.equivivre-shop.co.uk

    John

  8. #8
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Problem with customer registration - State field

    We discovered this issue some time back...

    If you start out with your store requiring users to TYPE IN their county/state, and a few customers sign up using this method... then you LATER switch to DROPDOWN... you will get a host of errors and difficulties with customers trying to register and login, and perhaps even check-out. This is particularly true for UK stores, because raw zencart does not do a default install of UK counties.

    So what happens is that UK people install zencart, and let it operate for a while, and then see that it would be advantageous (for shipping for example) to have the COUNTIES added to the database.

    Now... any customer that signed up BEFORE such counties were added to the dbase (and who TYPED IN their county), will not have the DBASE RELATIONAL ID applicable to their registration - and thus you get conflicts and errors.

    We found the only way to fix this was to MANUALLY change each such customer's details in the admin area, and SELECT their county from the dropdown, then SAVE their record.

    ---------------------------------------------------

    Additionally, the STATE dropdown will refer to the selected COUNTRY, and if you have states/counties set up for various countries, then it presents customers with some confusion when they FIRST have to select their STATE/COUNTY and then their COUNTRY and the system then asks them to select their county again...

    So, what we did is REVERSE the position of the COUNTRY and STATE fields in the sign-up form.

    When the signup form displays, people registering will FIRST select their COUNTRY... and THEN (because the system now knows the COUNTRY), it will present them with the dropdown for COUNTIES/STATES that are relevant to their COUNTRY. (if, of course, the STATES/COUNTIES are defined in the database - otherwise it invites users to type in their county.

    tpl_modules_create_account.php

    ORIGINAL VERSION
    PHP Code:
    <fieldset>
    <legend><?php echo TABLE_HEADING_ADDRESS_DETAILS?></legend>
    <?php
      
    if (ACCOUNT_GENDER == 'true') {
    ?>
    <?php 
    echo zen_draw_radio_field('gender''m''''id="gender-male"') . '<label class="radioButtonLabel" for="gender-male">' MALE '</label>' zen_draw_radio_field('gender''f''''id="gender-female"') . '<label class="radioButtonLabel" for="gender-female">' FEMALE '</label>' . (zen_not_null(ENTRY_GENDER_TEXT) ? '<span class="alert">' ENTRY_GENDER_TEXT '</span>'''); ?>
    <br class="clearBoth" />
    <?php
      
    }
    ?>

    <label class="inputLabel" for="firstname"><?php echo ENTRY_FIRST_NAME?></label>
    <?php echo zen_draw_input_field('firstname'''zen_set_field_length(TABLE_CUSTOMERS'customers_firstname''40') . ' id="firstname"') . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="alert">' ENTRY_FIRST_NAME_TEXT '</span>'''); ?>
    <br class="clearBoth" />

    <label class="inputLabel" for="lastname"><?php echo ENTRY_LAST_NAME?></label>
    <?php echo zen_draw_input_field('lastname'''zen_set_field_length(TABLE_CUSTOMERS'customers_lastname''40') . ' id="lastname"') . (zen_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="alert">' ENTRY_LAST_NAME_TEXT '</span>'''); ?>
    <br class="clearBoth" />

    <label class="inputLabel" for="street-address"><?php echo ENTRY_STREET_ADDRESS?></label>
      <?php echo zen_draw_input_field('street_address'''zen_set_field_length(TABLE_ADDRESS_BOOK'entry_street_address''40') . ' id="street-address"') . (zen_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="alert">' ENTRY_STREET_ADDRESS_TEXT '</span>'''); ?>
    <br class="clearBoth" />

    <?php
      
    if (ACCOUNT_SUBURB == 'true') {
    ?>
    <label class="inputLabel" for="suburb"><?php echo ENTRY_SUBURB?></label>
    <?php echo zen_draw_input_field('suburb'''zen_set_field_length(TABLE_ADDRESS_BOOK'entry_suburb''40') . ' id="suburb"') . (zen_not_null(ENTRY_SUBURB_TEXT) ? '<span class="alert">' ENTRY_SUBURB_TEXT '</span>'''); ?>
    <br class="clearBoth" />
    <?php
      
    }
    ?>

    <label class="inputLabel" for="city"><?php echo ENTRY_CITY?></label>
    <?php echo zen_draw_input_field('city'''zen_set_field_length(TABLE_ADDRESS_BOOK'entry_city''40') . ' id="city"') . (zen_not_null(ENTRY_CITY_TEXT) ? '<span class="alert">' ENTRY_CITY_TEXT '</span>'''); ?>
    <br class="clearBoth" />

    <?php
      
    if (ACCOUNT_STATE == 'true') {
        if (
    $flag_show_pulldown_states == true) {
    ?>
    <label class="inputLabel" for="stateZone" id="zoneLabel"><?php echo ENTRY_STATE?></label>
    <?php
          
    echo zen_draw_pull_down_menu('zone_id'zen_prepare_country_zones_pull_down($selected_country), $zone_id'id="stateZone"');
          if (
    zen_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="alert">' ENTRY_STATE_TEXT '</span>'
        }
    ?>

    <?php if ($flag_show_pulldown_states == true) { ?>
    <br class="clearBoth" id="stBreak" />
    <?php ?>
    <label class="inputLabel" for="state" id="stateLabel"><?php echo $state_field_label?></label>
    <?php
        
    echo zen_draw_input_field('state'''zen_set_field_length(TABLE_ADDRESS_BOOK'entry_state''40') . ' id="state"');
        if (
    zen_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="alert" id="stText">' ENTRY_STATE_TEXT '</span>';
        if (
    $flag_show_pulldown_states == false) {
          echo 
    zen_draw_hidden_field('zone_id'$zone_name' ');
        }
    ?>
    <br class="clearBoth" />
    <?php
      
    }
    ?>

    <label class="inputLabel" for="postcode"><?php echo ENTRY_POST_CODE?></label>
    <?php echo zen_draw_input_field('postcode'''zen_set_field_length(TABLE_ADDRESS_BOOK'entry_postcode''40') . ' id="postcode"') . (zen_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="alert">' ENTRY_POST_CODE_TEXT '</span>'''); ?>
    <br class="clearBoth" />

    <label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY?></label>
    <?php echo zen_get_country_list('zone_country_id'$selected_country'id="country" ' . ($flag_show_pulldown_states == true 'onchange="update_zone(this.form);"' '')) . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' ENTRY_COUNTRY_TEXT '</span>'''); ?>
    <br class="clearBoth" />
    </fieldset>

    OUR VERSION
    PHP Code:
    <fieldset>
    <legend><?php echo TABLE_HEADING_ADDRESS_DETAILS?></legend>
    <?php
      
    if (ACCOUNT_GENDER == 'true') {
    ?>
    <?php 
    echo zen_draw_radio_field('gender''m''''id="gender-male"') . '<label class="radioButtonLabel" for="gender-male">' MALE '</label>' zen_draw_radio_field('gender''f''''id="gender-female"') . '<label class="radioButtonLabel" for="gender-female">' FEMALE '</label>' . (zen_not_null(ENTRY_GENDER_TEXT) ? '<span class="alert">' ENTRY_GENDER_TEXT '</span>'''); ?>
    <br class="clearBoth" />
    <?php
      
    }
    ?>

    <label class="inputLabel" for="firstname"><?php echo ENTRY_FIRST_NAME?></label>
    <?php echo zen_draw_input_field('firstname'''zen_set_field_length(TABLE_CUSTOMERS'customers_firstname''40') . ' id="firstname"') . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? '<span class="alert">' ENTRY_FIRST_NAME_TEXT '</span>'''); ?>
    <br class="clearBoth" />

    <label class="inputLabel" for="lastname"><?php echo ENTRY_LAST_NAME?></label>
    <?php echo zen_draw_input_field('lastname'''zen_set_field_length(TABLE_CUSTOMERS'customers_lastname''40') . ' id="lastname"') . (zen_not_null(ENTRY_LAST_NAME_TEXT) ? '<span class="alert">' ENTRY_LAST_NAME_TEXT '</span>'''); ?>
    <br class="clearBoth" />

    <label class="inputLabel" for="street-address"><?php echo ENTRY_STREET_ADDRESS?></label>
      <?php echo zen_draw_input_field('street_address'''zen_set_field_length(TABLE_ADDRESS_BOOK'entry_street_address''40') . ' id="street-address"') . (zen_not_null(ENTRY_STREET_ADDRESS_TEXT) ? '<span class="alert">' ENTRY_STREET_ADDRESS_TEXT '</span>'''); ?>
    <br class="clearBoth" />

    <?php
      
    if (ACCOUNT_SUBURB == 'true') {
    ?>
    <label class="inputLabel" for="suburb"><?php echo ENTRY_SUBURB?></label>
    <?php echo zen_draw_input_field('suburb'''zen_set_field_length(TABLE_ADDRESS_BOOK'entry_suburb''40') . ' id="suburb"') . (zen_not_null(ENTRY_SUBURB_TEXT) ? '<span class="alert">' ENTRY_SUBURB_TEXT '</span>'''); ?>
    <br class="clearBoth" />
    <?php
      
    }
    ?>

    <label class="inputLabel" for="city"><?php echo ENTRY_CITY?></label>
    <?php echo zen_draw_input_field('city'''zen_set_field_length(TABLE_ADDRESS_BOOK'entry_city''40') . ' id="city"') . (zen_not_null(ENTRY_CITY_TEXT) ? '<span class="alert">' ENTRY_CITY_TEXT '</span>'''); ?>
    <br class="clearBoth" />

    <label class="inputLabel" for="country"><?php echo ENTRY_COUNTRY?></label>
    <?php echo zen_get_country_list('zone_country_id'$selected_country'id="country" ' . ($flag_show_pulldown_states == true 'onchange="update_zone(this.form);"' '')) . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' ENTRY_COUNTRY_TEXT '</span>'''); ?>
    <br class="clearBoth" />

    <?php
      
    if (ACCOUNT_STATE == 'true') {
        if (
    $flag_show_pulldown_states == true) {
    ?>
    <label class="inputLabel" for="stateZone" id="zoneLabel"><?php echo ENTRY_STATE?></label>
    <?php
          
    echo zen_draw_pull_down_menu('zone_id'zen_prepare_country_zones_pull_down($selected_country), $zone_id'id="stateZone"');
          if (
    zen_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="alert">' ENTRY_STATE_TEXT '</span>'
        }
    ?>

    <?php if ($flag_show_pulldown_states == true) { ?>
    <br class="clearBoth" id="stBreak" />
    <?php ?>
    <label class="inputLabel" for="state" id="stateLabel"><?php echo $state_field_label?></label>
    <?php
        
    echo zen_draw_input_field('state'''zen_set_field_length(TABLE_ADDRESS_BOOK'entry_state''40') . ' id="state"');
        if (
    zen_not_null(ENTRY_STATE_TEXT)) echo '&nbsp;<span class="alert" id="stText">' ENTRY_STATE_TEXT '</span>';
        if (
    $flag_show_pulldown_states == false) {
          echo 
    zen_draw_hidden_field('zone_id'$zone_name' ');
        }
    ?>
    <br class="clearBoth" />
    <?php
      
    }
    ?>

    <label class="inputLabel" for="postcode"><?php echo ENTRY_POST_CODE?></label>
    <?php echo zen_draw_input_field('postcode'''zen_set_field_length(TABLE_ADDRESS_BOOK'entry_postcode''40') . ' id="postcode"') . (zen_not_null(ENTRY_POST_CODE_TEXT) ? '<span class="alert">' ENTRY_POST_CODE_TEXT '</span>'''); ?>
    <br class="clearBoth" />

    </fieldset>
    We ALSO make similar changes to tpl_account_edit_default.php (the file that registered users need to CHANGE their address later)
    19 years a Zencart User

  9. #9
    Join Date
    Mar 2011
    Location
    In a green and pleasant land
    Posts
    46
    Plugin Contributions
    0

    Default Re: Problem with customer registration - State field

    Schoolboy
    Thanks so much for a most comprehensive and welcomed explanation.

    I guess that sort of sets me up for the rest of the weekend...now where's that gazetteer?

    Many thanks from the heart of Buckinghamshire (I think it will be about item 15 in the dropdown)

  10. #10
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,262
    Plugin Contributions
    3

    Default Re: Problem with customer registration - State field

    My advice is to do the following:

    When you INSTALL zc for the first time, BEFORE you go live, insert all the STATE/PROVINCE/COUNTY names relevant for your country. For UK users, this poses a bit of a problem, because there is no DEFINITIVE LIST of official UK counties! (Typical UK...).

    We go by ISO rules, and I believe there is a plugin that will insert UK counties - but I don't know if these are the "official" ISO names...

    Anyway... we have a list we use, and we populate the dbase with this list for the GB country ID.

    Kevin Polley has a UK TEMPLATE that will configure a UK store, and if you install it at the SAME TIME and IN CONJUNCTION WITH a ZC install, it will give you a fully-compliant UK store. I haven't been in touch with Kevin for a few years now, so I don't know how compatible his template is with ver 1.5. We modified his 1.3.7 version to meet the requirements of 1.3.9.

    We have a "manual work-around" when building a UK store on 1.5

    You should LOAD the counties/provinces/states for your country (and all others you intend selling in) BEFORE you unleash your store on the general public.

    Also, before you launch the site, configure the selector for county as DROP-DOWN, and set up your ZONE DEFINITIONS as well...

    If you make changes later, you will have issues.
    19 years a Zencart User

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Problem with new customer registration
    By dbalas in forum General Questions
    Replies: 1
    Last Post: 18 Sep 2009, 04:59 PM
  2. Problem with State Field
    By IncrediBody.com in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 16 May 2009, 10:12 PM
  3. State problem with new account (when making state field not required)
    By earmsby in forum Managing Customers and Orders
    Replies: 9
    Last Post: 13 May 2007, 10:04 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR