{"id":556,"date":"2020-06-09T14:34:44","date_gmt":"2020-06-09T13:34:44","guid":{"rendered":"https:\/\/www.graphicz.co.uk\/blog\/?p=556"},"modified":"2020-06-09T14:34:47","modified_gmt":"2020-06-09T13:34:47","slug":"requesting-location-early-generates-script-error-in-a-popup","status":"publish","type":"post","link":"https:\/\/www.graphicz.co.uk\/blog\/requesting-location-early-generates-script-error-in-a-popup\/","title":{"rendered":"Requesting Location Early Generates Script Error in a Popup"},"content":{"rendered":"\n<p>If you wish the client to enter their location early so that shipping etc can be defined, you need to ensure that &#8216;Quantity on confirmation Page&#8217; selected and that &#8216;Get location information early selected in Business settings.<\/p>\n\n\n\n<p>There is however a bug in V18 (SD-8179). When an item is added to cart, you can enter the country but when you enter the second state\/region a popup opens containing the html of a 500 script error.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><a class=\"fancybox\" href=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/ErrorBox.png\" rel='magnific'><img loading=\"lazy\" decoding=\"async\" width=\"1920\" height=\"1080\" src=\"https:\/\/i2.wp.com\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/ErrorBox.png?fit=550%2C309&amp;ssl=1\" alt=\"\" class=\"wp-image-557\" srcset=\"https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/ErrorBox.png 1920w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/ErrorBox-600x338.png 600w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/ErrorBox-1024x576.png 1024w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/ErrorBox-300x169.png 300w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/ErrorBox-768x432.png 768w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/ErrorBox-1536x864.png 1536w, https:\/\/www.graphicz.co.uk\/blog\/wp-content\/uploads\/2020\/06\/ErrorBox-250x141.png 250w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/a><\/figure>\n\n\n\n<p>I am grateful to Sellerdeck Development for this workaround solution:<\/p>\n\n\n\n<p>Open the file &#8216;actinicextras.js&#8217; in a plain text editor and locate the term &#8216;GetShippingClassesSelectHtml&#8217;. There are a couple of instances of this, but the one we are looking for is on line: 4110 or thereabouts.<\/p>\n\n\n\n<p>There you should see the following code: &#8211;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> function GetShippingClassesSelectHtml(cmbState)\n\t{\n\tif (cmbState.id.indexOf('Delivery') == -1)\n\t\t{\n\t\treturn;\n\t\t}\n\tShowLoadingDialog();\n<\/pre>\n\n\n\n<p>Replace this code with the following: &#8211;<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> function GetShippingClassesSelectHtml(cmbState)\n\t{\n\tif (cmbState.id.indexOf('Delivery') == -1)\n\t\t{\n\t\treturn;\n\t\t}\n\tvar elemShippingSelect = document.getElementById('idShippingSelect');\n\tif (!elemShippingSelect)\n\t\t{\n\t\treturn;\n\t\t}\n\tShowLoadingDialog();\n<\/pre>\n\n\n\n<p>save the file and upload the web site.<\/p>\n\n\n\n<p>I have tested this soltion and it does work, thank you again to Sellerdeck Development.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you wish the client to enter their location early so that shipping etc can be defined, you need to ensure that &#8216;Quantity on confirmation Page&#8217; selected and that &#8216;Get location information early selected in Business settings. There is however<span class=\"ellipsis\">&hellip;<\/span> <a href=\"https:\/\/www.graphicz.co.uk\/blog\/requesting-location-early-generates-script-error-in-a-popup\/\"><\/p>\n<div class=\"read-more\"><b>Read more &#8250;<\/b><\/div>\n<p><!-- end of .read-more --><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-556","post","type-post","status-publish","format-standard","hentry","category-graphicz-articles"],"_links":{"self":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/556"}],"collection":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/comments?post=556"}],"version-history":[{"count":1,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/556\/revisions"}],"predecessor-version":[{"id":558,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/posts\/556\/revisions\/558"}],"wp:attachment":[{"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/media?parent=556"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/categories?post=556"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.graphicz.co.uk\/blog\/wp-json\/wp\/v2\/tags?post=556"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}