{"id":1978,"date":"2018-11-19T11:08:46","date_gmt":"2018-11-19T16:08:46","guid":{"rendered":"http:\/\/www.thatsoftwareguy.com\/blog\/?p=1978"},"modified":"2018-11-19T11:08:46","modified_gmt":"2018-11-19T16:08:46","slug":"bug-always-display-state-as-a-pulldown-in-zen-cart-1-5-5","status":"publish","type":"post","link":"https:\/\/www.thatsoftwareguy.com\/blog\/2018\/11\/19\/bug-always-display-state-as-a-pulldown-in-zen-cart-1-5-5\/","title":{"rendered":"BUG: Always Display State as a Pulldown in Zen Cart 1.5.5"},"content":{"rendered":"<p>There&#8217;s a bug in Zen Cart 1.5.5 that causes the State dropdown not to be correctly populated when you set\u00a0<code>Configuration-&gt;Customer Details-&gt;State - Always display as pulldown<\/code>to true in <code>Admin-&gt;Configuration-&gt;Customer Details.<\/code>\u00a0 It causes your State dropdown menu to look like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1979 size-large\" src=\"http:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2018\/10\/no_state-1024x120.png\" alt=\"Zen Cart State dropdown without state set\" width=\"660\" height=\"77\" srcset=\"https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2018\/10\/no_state-1024x120.png 1024w, https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2018\/10\/no_state-300x35.png 300w, https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2018\/10\/no_state-768x90.png 768w, https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2018\/10\/no_state.png 1130w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>\n<p>even though the value of State has been set.<\/p>\n<p>You can see the root cause of this error in the Chrome Javascript debugger.\u00a0 Right click and select <code>Inspect<\/code>, then click the <code>Console<\/code>\u00a0tab, and you&#8217;ll see the traceback for the error.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-1980 size-large\" src=\"http:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2018\/10\/no_state_error_traceback-1024x64.png\" alt=\"Traceback in Zen Cart for no state error in 1.5.5\" width=\"660\" height=\"41\" srcset=\"https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2018\/10\/no_state_error_traceback-1024x64.png 1024w, https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2018\/10\/no_state_error_traceback-300x19.png 300w, https:\/\/www.thatsoftwareguy.com\/blog\/wp-content\/uploads\/2018\/10\/no_state_error_traceback-768x48.png 768w\" sizes=\"auto, (max-width: 660px) 100vw, 660px\" \/><\/p>\n<p>The root cause of the error was that the <code>stText<\/code>\u00a0element id was removed from the default template Zen Cart 1.5.5, an attempt to modify that DOM element failed, and stopped JavaScript processing.\u00a0 The fix was straightforward; just check for this element&#8217;s existence before updating it.\u00a0 You can <a href=\"https:\/\/github.com\/zencart\/zencart\/pull\/1831\">pull the fix from Github<\/a> and apply it to your Zen Cart 1.5.5 site, or <a href=\"https:\/\/www.thatsoftwareguy.com\/store\/index.php?main_page=product_info&amp;cPath=10&amp;products_id=6\">hire me to do it<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There&#8217;s a bug in Zen Cart 1.5.5 that causes the State dropdown not to be correctly populated when you set\u00a0Configuration-&gt;Customer Details-&gt;State &#8211; Always display as pulldownto true in Admin-&gt;Configuration-&gt;Customer Details.\u00a0 It causes your State dropdown menu to look like this: even though the value of State has been set. You can see the root cause &hellip; <a href=\"https:\/\/www.thatsoftwareguy.com\/blog\/2018\/11\/19\/bug-always-display-state-as-a-pulldown-in-zen-cart-1-5-5\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">BUG: Always Display State as a Pulldown in Zen Cart 1.5.5<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58,78],"tags":[],"class_list":["post-1978","post","type-post","status-publish","format-standard","hentry","category-that-software-guy","category-zen-cart"],"_links":{"self":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/1978","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/comments?post=1978"}],"version-history":[{"count":2,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/1978\/revisions"}],"predecessor-version":[{"id":1982,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/posts\/1978\/revisions\/1982"}],"wp:attachment":[{"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/media?parent=1978"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/categories?post=1978"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thatsoftwareguy.com\/blog\/wp-json\/wp\/v2\/tags?post=1978"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}