osCmax v2.5 User Manual
Results 1 to 3 of 3

User registration problem with State Abbreviation!!!

This is a discussion on User registration problem with State Abbreviation!!! within the osCmax v1.7 Discussion forums, part of the osCmax v1.7 Forums category; User registration problem with State Abbreviation!!! How do you get OSCommerce to either allow the abbreviation or show the dropdown ...

      
  1. #1
    osCMax Testing Team
    Join Date
    Jul 2004
    Posts
    30
    Rep Power
    0


    Default User registration problem with State Abbreviation!!!

    User registration problem with State Abbreviation!!!

    How do you get OSCommerce to either allow the abbreviation or show the dropdown list by default.

    Whenever I setup an account, if I use the abbreviation and submit it, it will throw out an error and then give you a drop-down list as an option. This is kinda weird.

    I found a contrib for this, but the file to replace doesn't exist in OSCommerce (it may have been designed for an older version).
    Contrib link: http://www.oscommerce.com/community/contributions,990

    Please tell me of any suggestions!!!

  2. #2
    osCMax Testing Team
    Join Date
    Jul 2004
    Posts
    30
    Rep Power
    0


    Default

    Actually I found a code level workaround. This allows you to enter either the abbreviation or the full state name and it is not case sensitive...

    Code:
     //This is the old query, the new one is posted below, this adjustment allows state abbreviations...
     //$zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name like '" . tep_db_input($state) . "%' or zone_code like '%" . tep_db_input($state) . "%')");
    
    //This is the new code that is more leaniant
           $zone_query = tep_db_query("select distinct zone_id from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' and (zone_name = '" . tep_db_input($state) . "' OR zone_code = '" . tep_db_input($state) . "')");
    The last line of code is what I used to fix it in create_account.php, which is located in the root of the catalog. The code itself is on or about line 135. I use OSCommerce v1.8 MS2-MAX. I got the basics of the code from that contribution I talked about in my first post, but had to adjust it some because the code was 2 years old and not correct with the current version. However the code I posted in this post is correct and works fine.

  3. #3
    osCMax Testing Team
    Join Date
    Jul 2004
    Posts
    30
    Rep Power
    0


    Default

    Ok, I have now packaged this into a contribution.

    This contribution can be found at:
    http://www.oscommerce.com/community/contributions,2316

    It explains everything in detail.
    I have no name, I am only PhatGOD!

Similar Threads

  1. Problem with Authorize.net mod after adding new user ID and
    By cpeters in forum osCMax v1.7 General Mods Discussion
    Replies: 2
    Last Post: 04-27-2005, 09:48 AM
  2. installation problem, hangs after database server,user name
    By splatacat in forum osCMax v1.7 Installation
    Replies: 2
    Last Post: 12-23-2004, 06:34 AM
  3. Uploaded product Images and user.group account problem
    By red_fraggle in forum osCMax v1.7 Installation
    Replies: 0
    Last Post: 11-06-2004, 01:02 PM
  4. user tracking with admin 1.35 problem
    By robroymedia in forum osCMax v1.7 General Mods Discussion
    Replies: 2
    Last Post: 10-11-2004, 01:03 AM
  5. affiliate registration problem
    By battleaxe in forum osCmax v1.7 Discussion
    Replies: 10
    Last Post: 06-21-2004, 10:02 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
  •