D
D
Dmitry Boyarshinov2020-07-04 10:22:20
WordPress
Dmitry Boyarshinov, 2020-07-04 10:22:20

How to solve wc-ajax error?

Good day, experts!
Site - https://raki96.rf I encountered
a problem when placing an order on the site WP(5.4.2)+WC(4.2.2)+Avada theme(5.9.1).
403 error on checkout page.
5f002dd87ac36185766353.png

I've already broken my head.
How can this be fixed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Ermilov, 2020-07-05
@sergeiermilov

Most likely, just clearing cookies in the browser will save you.
You can also add this to wp-config.php:

define( 'ADMIN_COOKIE_PATH', '/' );
define( 'COOKIE_DOMAIN', '' );
define( 'COOKIEPATH', '' );
define( 'SITECOOKIEPATH', '' );

There is also an opinion on the Internet that the problem is related to redirection and SSL, this line helped some:
define( 'FORCE_SSL_ADMIN', true );
if ( strpos( $_SERVER['HTTP_X_FORWARDED_PROTO'], 'https' ) !== false ) {
  $_SERVER['HTTPS'] = 'on';
}

Well, it might also be worth adding this line to functions.php:
add_filter( 'wc_session_use_secure_cookie', '__return_true' );

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question