Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,495
    Plugin Contributions
    88

    Default [Done v1.3.9] Drop-down states only show selected state for default country

    Running 1.38a+FEC+security.

    If a customer creates an address-book entry for a country OTHER THAN the store's default country and then goes to update that entry, the drop-down for State/Province shows "Please select" instead of the previously-stored selection.

    The selection is in the database (checked via phpMyAdmin). The problem appears to surface within \includes\modules\pages\address_book_process\header_php.php at line 304:

    Code:
      $selected_country = (isset($_POST['zone_country_id']) && $_POST['zone_country_id'] != '') ? $country : SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY;
    This statement, on entry from a 'edit' request, always goes down the 'false' path because at that point, nothing from the form has been posted.

    I'm not sure what the 'proper' fix is ... please help.

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,495
    Plugin Contributions
    88

    Default Re: Drop-down states only show selected state for default country

    FWIW (if anyone else has this problem), I solved it by changing the line referenced in my first post to:

    Code:
      if ($process == false) {
        $selected_country = $entry->fields['entry_country_id'];
      } else {
        $selected_country = (isset($_POST['zone_country_id']) && $_POST['zone_country_id'] != '') ? $country : SHOW_CREATE_ACCOUNT_DEFAULT_COUNTRY;
      }

  3. #3
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,495
    Plugin Contributions
    88

    Default Re: Drop-down states only show selected state for default country

    I found the cool demo site referenced by this post:

    http://www.zen-cart.com/forum/showth...379#post269379

    The base country for the demo store I ran was US.

    I went into admin and changed the State Pulldown's selection to 'true'.

    I created a US-based account (you have to press 'refresh' after the e-mail boo-boo message) and went to My Account. I added another address based in Canada, chose Alberta as the province and saved the address.

    I then went to update the Canada-based address. The state pulldown showed 'Please select...' instead of 'Alberta'.

 

 

Similar Threads

  1. v150 Removing Country Checkout Field | US only | State Drop Down
    By jeff768 in forum Templates, Stylesheets, Page Layout
    Replies: 13
    Last Post: 8 Jan 2021, 06:19 PM
  2. Force State/Province dropdown to show relevant options for selected COUNTRY
    By schoolboy in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 13 Dec 2010, 12:54 PM
  3. Have a pre-set zone appear as default in the State drop down?
    By orange_juice in forum Customization from the Admin
    Replies: 2
    Last Post: 3 Sep 2010, 09:59 AM
  4. Replies: 6
    Last Post: 31 Mar 2009, 04:59 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
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR