Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2008
    Posts
    8
    Plugin Contributions
    0

    Default [Done 1.3.9a] 1.3.8a-"State/Province" becomes blank -Updating Address book

    Hello,

    I'm using ZenCart 1.3.8a.

    We have a problem with updating Address Book Entry.
    It happens with the setting "State - Always display as pulldown" is True.


    When a customer ,in a country which does not have state pulldown list, tries to change his adress in his Address Book, his state information becomes blank.
    So,need to type the state name agin to go though.

    Any suggestions?

    Thanks for any input!

    Yuji

  2. #2
    Join Date
    Jan 2010
    Posts
    18
    Plugin Contributions
    0

    red flag Re: 1.3.8a-"State/Procince" becomes blank -Update Adress book

    I have the same problem. Also with version 1.3.8a. Would seem to be a bug unfortunately.

    My current Configuration\Customer Details settings:

    State :: true
    State - Always display as pulldown? :: true

    My current Configuration\Minimum Values settings:

    State :: [empty] (NOT the numeral zero)

    [note: this is so State can be optional for countries that do not have states/provinces]

    I will try my best to investigate/fix the code myself (might take a while as I'm new to both PHP and Zen Cart), but it would be ace if someone else has already has come up with a fix for this?

    If I don't hear anything back, I will post my solution here if and when I manage to get somewhere. If I do post some code, it would be fab if someone from the Zen team could look over what I've done?

    Thanks and best wishes,
    Jean-Paul

  3. #3
    Join Date
    Jan 2010
    Posts
    18
    Plugin Contributions
    0

    Idea or Suggestion Re: 1.3.8a-"State/Province" becomes blank -Update Address book

    Well, I've found the offending line of code in tpl_modules_address_book_details.php

    echo zen_draw_input_field('state', zen_get_zone_name($entry->fields['entry_country_id'], $entry->fields['entry_zone_id'], $entry->fields['entry_state']), zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' id="state"');

    Changing the name of the Input field from 'state' to anything else (for example 'TEST_state') solves the problem. However, I don't yet know why nor what else this might break. So don't go changing this code just yet!

    Would appreciate any leads - if any of the Zen Cart team are reading this?!

    Thanks!
    Jean-Paul

  4. #4
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: 1.3.8a-"State/Province" becomes blank -Update Address book

    You'll need to make changes in 3 places, on 2 lines of code:
    /includes/modules/pages/address_book_process/header_php.php
    line 70, change as shown:
    Code:
        $state = (isset($_POST['state'])) ? zen_db_prepare_input($_POST['state']) : FALSE;
    line 307, change as shown:
    Code:
      $state = ($flag_show_pulldown_states && $state != FALSE) ? $state : $zone_name;
    Last edited by DrByte; 20 Feb 2010 at 06:18 AM. Reason: fixed typo
    .

    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.

  5. #5
    Join Date
    Jan 2010
    Posts
    18
    Plugin Contributions
    0

    Default Re: [Done 1.3.9] 1.3.8a-"State/Province" becomes blank -Updating Address book

    Thanks so much for your reply. Was taking me forever to work out. Still not familiar enough with Zen Cart and PHP I guess. Probably would have got there eventually but I certainly appreciate your prompt response! Owe you a cup of coffee.

    I'll try out your solution and will only post again here if I encounter any further problems with this particular issue. Thanks again.

  6. #6
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,824
    Plugin Contributions
    31

    Default Re: [Done 1.3.9] 1.3.8a-"State/Province" becomes blank -Updating Address book

    I'm a bit confused, changes are required in 3 places ?
    Last edited by torvista; 21 Feb 2010 at 02:43 AM.

  7. #7
    Join Date
    Jul 2006
    Location
    Montreal, Canada
    Posts
    2,279
    Plugin Contributions
    0

    Default Re: [Done 1.3.9] 1.3.8a-"State/Province" becomes blank -Updating Address book

    Quote Originally Posted by torvista View Post
    I'm a bit confused, changes are required in 3 places ?
    3 places on 2 line of code , if you look at the code DrByte has mentioned you will see the changes are in Red and there are 3 of them within 2 line

  8. #8
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,824
    Plugin Contributions
    31

    Default Re: [Done 1.3.9] 1.3.8a-"State/Province" becomes blank -Updating Address book

    Doh!
    thanks, yes, completely obvious, sometimes you look but you just don't see

 

 

Similar Threads

  1. v150 "Always free shipping" becomes "not possible"
    By kalastaja in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 8 Mar 2013, 08:00 PM
  2. State Field Blank for all customers in address book
    By mgrunk in forum Managing Customers and Orders
    Replies: 0
    Last Post: 15 Apr 2010, 08:13 PM
  3. "Select State/Province" on Login Page Issue
    By lucky-nz in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 22 Feb 2010, 12:14 AM
  4. "Array()" line on "Update Address Book" page
    By vera in forum Managing Customers and Orders
    Replies: 10
    Last Post: 22 Sep 2006, 03:06 AM

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