Hello,
An AJAX error usually happens when a PHP error occurs during the AJAX request. So we should be able to understand what is going wrong thanks to the PHP error logs.
Can you
1.
Replace in wp-config.php
define(‘WP_DEBUG’, false);
with:
define(‘WP_DEBUG’, true);
define(‘WP_DEBUG_LOG’, true);
define(‘WP_DEBUG_DISPLAY’, false);
2.
Reproduce the error (“An AJAX error occurred.”)
3.
Then, can you send me the wp-content/debug.log file (if it has appeared)? You can send it to me at contact@booking-activities.fr.
Thanks. This could easily be down to code that we’re calling from hooks then. We’ll check the wp debug logs at those times.
I think I’ve found it.
[06-Oct-2022 01:36:16 UTC] PHP Notice: Function get_cart was called <strong>incorrectly</strong>. Get cart should not be called before the wp_loaded action. Backtrace: require('wp-blog-header.php'), require_once('wp-load.php'), require_once('wp-config.php'), require_once('wp-settings.php'), do_action('init'), WP_Hook->do_action, WP_Hook->apply_filters, Essential_Addons_Elementor\Classes\Bootstrap->login_or_register_user, Essential_Addons_Elementor\Classes\Bootstrap->log_user_in, wp_signon, do_action('wp_login'), WP_Hook->do_action, WP_Hook->apply_filters, bookacti_change_customer_id_to_user_id, bookacti_wc_get_cart_items_bookings, WC_Cart->get_cart, wc_doing_it_wrong Please see <a href="https://wordpress.org/support/article/debugging-in-wordpress/">Debugging in WordPress</a> for more information. (This message was added in version 2.3.) in /www/tradingresearchgroup_729/public/wp-includes/functions.php on line 5831
The context here is that the booking form redirects to another page after the booking has been made.
Probably not, the AJAX error is shown only if the PHP process is interrupted, a PHP Notice doesn’t stop the process, we are looking for a PHP error.
This notice shows an compatibility issue between “Essential_Addons_Elementor” and Booking Activities. Essential_Addons_Elementor plugin should not try to log in or register a user on “init” hook, it should be on “wp_loaded” hook or after.