Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,690
    Plugin Contributions
    123

    Default Configuration->Customer Details->State - Always display as pulldown?

    This seems to cause existing addresses to not have their states correctly selected in the dropdown menu. Instead, the displayed value is "Please select ..." instead of Florida (in my case).

    The page looks correct to me - here's the select block:

    Code:
    <select name="zone_id" id="stateZone">
      <option value="">Please select ...</option>
    ... 
      <option value="18" selected="selected">Florida</option>
    but it doesn't work show the selected value on the dropdown in either responsive_classic or template_default.

    This *did* work properly in Zen Cart 1.5.4. I'm guessing some new javascript in 1.5.5 has broken it.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  2. #2
    Join Date
    Feb 2010
    Location
    Syracuse, NY
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Configuration->Customer Details->State - Always display as pulldown?

    I have always replaced:
    HTML Code:
    selected="selected"
    with:
    HTML Code:
     selected
    I think from the beginning of using zen cart. Always forget to bring it up though.
    Website - Github. Like the ZCA Bootstrap 4 Template? Donations Welcome. Bootstrap Plugins?

  3. #3
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,690
    Plugin Contributions
    123

    Default Re: Configuration->Customer Details->State - Always display as pulldown?

    No, that's not it. Both of these syntaxes are correct.

    Like I said, this is new to 1.5.5. This appears to be the problem: in 1.5.5, these four templates were changed:
    ./templates/template_default/templates/tpl_modules_shipping_estimator.php
    ./templates/template_default/templates/tpl_modules_create_account.php
    ./templates/template_default/templates/tpl_modules_checkout_new_address.php
    ./templates/template_default/templates/tpl_modules_address_book_details.php

    so that when the state field is written out, in the alert next to it, tag id="stText" is no longer used.

    This means the update of this element

    document.getElementById("stText").className = 'hiddenField';
    document.getElementById("stText").setAttribute('className', 'hiddenField')

    in the four hideStateField functions

    ./modules/pages/create_account/jscript_addr_pulldowns.php
    ./modules/pages/checkout_shipping_address/jscript_addr_pulldowns.php
    ./modules/pages/checkout_payment_address/jscript_addr_pulldowns.php
    ./modules/pages/address_book_process/jscript_addr_pulldowns.php

    should check that this element exists prior to updating it.

    I'll prepare a PR.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  4. #4
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,690
    Plugin Contributions
    123

    Default Re: Configuration->Customer Details->State - Always display as pulldown?

    PR is here:
    https://github.com/zencart/zencart/pull/1831

    This can be directly backported to 1.5.5 carts which are experiencing this issue.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

  5. #5
    Join Date
    Sep 2008
    Location
    DownUnder, overlooking South Pole.
    Posts
    976
    Plugin Contributions
    6

    Default Re: Configuration->Customer Details->State - Always display as pulldown?

    Similar thread (2016-2018)

    https://www.zen-cart.com/showthread....cript-failures

    Have not looked at your problem myself, but do recall fixing something like this several years ago.

    cheers

  6. #6
    Join Date
    Feb 2006
    Location
    Tampa Bay, Florida
    Posts
    9,690
    Plugin Contributions
    123

    Default Re: Configuration->Customer Details->State - Always display as pulldown?

    LOL you're right. I searched for the symptom I had (always display state as pulldown causes problems) but I didn't search for stText once I had figured out the issue; I just fixed it and submitted the PR.
    That Software Guy. My Store: Zen Cart Modifications
    Available for hire - See my ad in Services
    Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
    Do you benefit from Zen Cart? Then please support the project.

 

 

Similar Threads

  1. Replies: 7
    Last Post: 8 Apr 2012, 11:47 PM
  2. State required for Admin changes to Customer details
    By Dustie in forum Customization from the Admin
    Replies: 2
    Last Post: 25 Dec 2010, 06:11 PM
  3. State - Always display as pulldown screwing up template
    By Delights in forum Templates, Stylesheets, Page Layout
    Replies: 4
    Last Post: 9 Oct 2010, 06:14 PM
  4. Replies: 1
    Last Post: 2 May 2010, 09:56 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