1. Documentation /
  2. Endless loading/spinner on the checkout page

Endless loading/spinner on the checkout page

The ‘review order’ page loads the payment methods/totals via ajax – this display a loading spinner briefly. If there are problems, this section may fail to load or the spinner may remain. First you should check WooCommerce > System Status for errors – often errors will be highlighted. Still having problems? Common causes and resolutions are listed below.

AJAX error due to WordPress settings.

↑ Back to top
The URL’s in Settings > General need to match – this is because AJAX requests don’t work across different domains:
These URL’s must match
Read more on how to update WordPress and site URL’s.

Other JavaScript errors and conflicts

↑ Back to top
Themes and plugins can often cause problems (especially poorly coded ones!) with JavaScript. To check for errors use your browser’s error console.
Chrome shows errors on its console
Read more on how to test for theme and plugin conflict.

Invalid Response from an AJAX Call

↑ Back to top
View the XHR tab on your browser’s developer console and look at the response. The expected response would be JSON. If the response is HTML this can be caused by a couple of different things. Oftentimes this is caused by an index.html file in the root directory of the WordPress installation This can be resolved by either removing the index.html file or by adjusting the indexes directive on the server configuration and prioritizing index.php over index.html. Some caching plugins will also prepend HTML to the JSON response. You may also see a response of -1, This is a security failure and is caused by a cached nonce. You can also check for conflicts by turning off other plugins and switching to the default WordPress theme – this will often reveal the problem.

Transactional Emails causing trouble

↑ Back to top
On some servers, the sending of checkout-related emails can cause trouble. You can enable the following filter to defer emails from sending until after the order is sent through, which speeds things up:

add_filter( 'woocommerce_defer_transactional_emails', '__return_true' );

Note: This is a Developer level doc. If you are unfamiliar with code/templates and resolving potential conflicts, select a WooExpert or Developer for assistance. We are unable to provide support for customizations under our Support Policy.

You need to add this code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Please don’t add custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.

WP Memory Limit

↑ Back to top
We recommend at least 64MB. See: Increasing the WP Memory Limit