简体   繁体   中英

Uncaught TypeError: Cannot read property 'geoCountry' of null

In my magento one page checkout module throw error of jquery below error message.

Uncaught TypeError: Cannot read property ' geoCountry ' of null from checkout.js

Website url is http://ffoa.com.au/

I know its an old question but I just stumbled into the same problem, I used the mt-divas theme which uses also /iwd/opc/checkout.js like your site.

The Error "Cannot read property 'geoCountry' of null" appeared when the user was not logged and checkout as guest is not allowed. In this case when you trying to go to checkout without being logged in you'll see the loggin form on the /onestepcheckout site. The opc.js is loaded but can't access some data.

solution remove the js from the site when user is not logged in:

<customer_logged_out>
<reference name="head">
<!-- For a JS in the js folder -->
<action method="removeItem"><type>js</type><name>iwd/opc/checkout.js</name>       </action>
<action method="removeItem"><type>js</type><name>iwd/opc/extend.js</name>    </action>
</reference>
</customer_logged_out>

in iwd_opc.xml or local.xml

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM