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

weird problem when customer creates account

This is a discussion on weird problem when customer creates account within the osCmax v1.7 Discussion forums, part of the osCmax v1.7 Forums category; Hi I have installed all the uk counties as zones, and set the default country to UK (222), however, when ...

      
  1. #1
    Active Member
    Join Date
    May 2004
    Location
    somewhere above colchester uk
    Posts
    147
    Rep Power
    0


    Default weird problem when customer creates account

    Hi

    I have installed all the uk counties as zones, and set the default country to UK (222), however, when i try to create a new customer account the field for Sate (which is my County field) is a plain text box. However, if I make a mistake in the form and it refreshes, the State field then becomes the drop down box that I want with all my counties in it as it should be.

    Beneath is the code pertaining to 'state' in create_account_tpl.php - can anyone see what is wrong, cos I have spent all day on this and for the life of me cant find it.

    <?php
    if (ACCOUNT_STATE == 'true') {
    ?>
    <tr>
    <td class="main"><?php echo ENTRY_STATE; ?></td>
    <td class="main">
    <?php
    if ($process == true) {
    if ($entry_state_has_zones == true) {
    $zones_array = array();
    $zones_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . (int)$country . "' order by zone_name");
    while ($zones_values = tep_db_fetch_array($zones_query)) {
    $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
    }
    echo tep_draw_pull_down_menu('state', $zones_array);
    } else {
    echo tep_draw_input_field('state');
    }
    } else {
    echo tep_draw_input_field('state');
    }

    if (tep_not_null(ENTRY_STATE_TEXT)) echo ' <span class="inputRequirement">' . ENTRY_STATE_TEXT;
    ?>
    </td>
    </tr>
    ps I have tried the code from here http://forums.oscommerce.com/index.p...53879&st=0 and it works fine, but only really works if you only ship to one country

    cheers for any help
    Kim
    Google says be nice!

  2. #2
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default RE: weird problem when customer creates account

    This is an annoying bug that has been in osCommerce for a long time. This mod fixes it:

    http://www.oscommerce.com/community/...,country+state
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  3. #3
    Active Member
    Join Date
    May 2004
    Location
    somewhere above colchester uk
    Posts
    147
    Rep Power
    0


    Default RE: weird problem when customer creates account

    Cheers Michael


    I have done as you suggested (don't I always) and I have made a clean install of the country and state mod and I now have it working. I installed the latest edition with all the extra stuff in the javascript file.

    There is a nice dropdown box now for 'state'

    However, i am still coming up with another problem: When I change country, the page does not refresh the state drop down box. For example, my default is united kingdom, and if I change the country using the dropdown box from that to (for instance) the USA, the zones in the 'state' dropdown box remain UK counties and not US states.

    I have 2 form_check.js.php files (presumably cos MAX uses BTS) and I have added the new code (as per the mod) to both of them. I use the latest firefox, but have tested in IE6 also and the problem is the same, no refresh of 'states' dropdown box. Bit of a setback if someone outside the UK wants to use it!

    Any help or suggestions would be greatly appreciated.

    Cheers
    kim
    Google says be nice!

  4. #4
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default RE: weird problem when customer creates account

    You need to specifically add this to your main_page.tpl.php file in the <head> section:

    Code:
    <?php require('includes/javascript/form_check.js.php'); ?>
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  5. #5
    Active Member
    Join Date
    May 2004
    Location
    somewhere above colchester uk
    Posts
    147
    Rep Power
    0


    Default RE: weird problem when customer creates account

    Cheers Michael

    I so much wanted to say whoopeee, thats cracked it but.... I tried it in head under the following code
    <?php if ($javascript) { require(DIR_WS_JAVASCRIPT . $javascript); }?> and then at the top of the head section, but no change, either in IE6 or Firefox.

    I know there was an issue with Javascript with the XP sp2 upgrade, but I have checked it on a machine that escaped that upgrade, and it still doesnt refresh at all
    Google says be nice!

  6. #6
    osCMax Developer

    michael_s's Avatar
    Join Date
    Jul 2002
    Location
    Phoenix, AZ
    Posts
    19,907
    Rep Power
    568


    Default RE: weird problem when customer creates account

    Put it above <?php if ($javascript) { require(DIR_WS_JAVASCRIPT . $javascript); }?> and it will work. If not, make sure you have correctly added the function to includes/javascript/form_check.js.php

    I have it working in the dev version of osCMax and that is the exact issue I had. It will work for you eventually. Basically, the problem is that your template is loading form_check.js.php or trying to, but it cannot find the page refresh function.

    I suggest debugging in Firefox. Load the page, try to change the country and then open the Firefox Javscript console. You will see an error telling you what the issue is.
    Michael Sasek
    osCMax Developer


    osCmax Installation Service
    - Have our professionals install osCmax on your server - same day service!
    osCmax 2.5 User Manual - the must have beginners guide to osCmax v2.5

    Stay Up To Date with everything osCMax:
    Free osCmax Newsletters - Security notices, New Releases, osCMax News
    osCmax on Twitter - Up to the minute info as it happens. Know it first.

    osCmax Documentation

  7. #7
    Active Member
    Join Date
    May 2004
    Location
    somewhere above colchester uk
    Posts
    147
    Rep Power
    0


    Default RE: weird problem when customer creates account

    Thanks Michael, whoopee, sorted.

    The problems were that :-because of BTS, some of the new code had to go in template files instead of the create_account.php... in fact the instructions for modding that file for MAX should indicate 3 files...mainpage.tpl.php, create_account.tpl.php and create_account.php. Maybe I should add a readme file for MS2 MAX so that people here can mod for this contribution more easily. Although if people are paying attention, if they pull up those files in Dreamweaver they can do it with a Find - Replace function, so long as they check on each file.

    thanks loads
    Kim
    Google says be nice!

Similar Threads

  1. Email not sent after new customer account is created.
    By Dumb_Question in forum osCmax v2 Installation issues
    Replies: 7
    Last Post: 12-16-2005, 04:37 PM
  2. Weird problem
    By Walter in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 06-14-2004, 04:43 PM
  3. customer account requirements
    By cutxpaste in forum osCommerce 2.2 Modification Help
    Replies: 3
    Last Post: 11-07-2003, 08:51 PM
  4. Weird problem >>> editing some products and categor
    By Anonymous in forum osCmax v1.7 Discussion
    Replies: 0
    Last Post: 10-27-2003, 11:21 AM

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
  •