Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WooCommerce: Cannot read property 'reload' of null checkout.min.js?

Running Wordpress 4.1.5 and WooCommerce 2.3.8 using the WooPress - 8theme WordPress theme. On the checkout page when I hit "Place Order" it stalls and in the console I get:

Uncaught TypeError: Cannot read property 'reload' of null from checkout.min.js. I replaced it with a non minified version and deducted it comes from here:

            $.ajax({
                type:       'POST',
                url:        wc_checkout_params.checkout_url,
                data:       $form.serialize(),
                success:    function( code ) {

Turns out that code is null. The action that was requested was wp-admin/admin-ajax.php?action=woocommerce_checkout. Why would this be null?

Note: For the payment vendor I'm using the AuthorizeNetAIM plugin ( from codecanyon ) and using the test mode + sandbox login.

Update #1: Attempted this fix: http://www.tech.theplayhub.com/woocommerce_js_issue_on_checkout/

by disabling email notifications. No luck.

Update #2: Attempted this fix: https://github.com/woothemes/woocommerce/issues/5332

In that case the user had a culprit FB plugin and had to disable it.

The only plugins I have installed:

  • RevolutionSlider 4.6.5
  • WC Authorize.Net AIM 1.2.1
  • WooCommerce 2.3.8
  • WPBakery Visual Composer 4.4.3

Update #3: Downgraded WooCommerce 2.3.8 to 2.3.0 because the theme I'm using ( 8theme / woopress ) has woocommerce 2.3.0 files. Same thing. Also tried changing the theme to a bare ( TwelveFourteen etc ) theme. Same thing.

I suspect this might be the AuthorizeNet AIM plugin failing / throwing an exception except the code isn't picking it up somehow.

like image 999
meder omuraliev Avatar asked Oct 20 '22 12:10

meder omuraliev


1 Answers

Turned out to be this: cURL requires CURLOPT_SSL_VERIFYPEER=FALSE)

Basically, the plugin I was using was using an outdated cert.pem file.

Module in question: http://codecanyon.net/item/authorizenet-aim-payment-module-for-woocommerce/1991981

File in question: wp-content/plugins/wc-authorize-aim/includes/lib/ssl/cert.pem.

Though arguably the error handling of plugins/woocommerce/assets/js/frontend/checkout.min.js could be better improved to detect if there is any actual response.

like image 173
meder omuraliev Avatar answered Oct 28 '22 23:10

meder omuraliev