Variations not adding to cart
-
With all the plugins uninstalled, I can’t add anything to the cart if is a variation product.
It keeps spinning and I see a Java error when I’m inspecting the issue:
https://drive.google.com/file/d/15oa8MzL7sktYENofshdAJW4Mj1oGwSLY/view?usp=drivesdk
Your help is much appreciated!
Hello,
Thank you so much for purchasing our theme and contacting our support center.
Hello,
Sorry for the delay.
Try to add the following PHP code snippet to the child theme functions.php file to fix this
add_filter('woocommerce_add_to_cart_redirect', function( $url ) {
if( strpos( $url, 'product-added-to-cart' ) > 0 || strpos( $url, 'product_added_to_cart' ) > 0) {
if ( isset( $_REQUEST['wd-add-to-cart'] ) ) {
return wc_get_checkout_url();
}
return '';
}
return $url;
}, PHP_INT_MAX);
Kind Regards
XTemos Studio
You are always welcome. Feel free to contact us if you have any further questions.
The topic ‘Variations not adding to cart’ is closed to new replies.