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.
Re: Configuration->Customer Details->State - Always display as pulldown?
I have always replaced:
HTML Code:
selected="selected"
with:
I think from the beginning of using zen cart. Always forget to bring it up though.
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.
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.
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
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.