problem with add to cart” b
-
Hello,
I want to report a problem, when I am on a product and I click on “add to cart”, the rotation does not stop and the product is not added to the cart until I refresh the page.
Hi,
Could you please send us a link to your website where we can see this issue?
Kind Regards
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
it works on the store page but not on the single product page
Please, send us a screenshot of where exactly you added the code so we can see if it is correct.
Kind Regards
Okay
Attachments:
You must be
logged in to view attached files.
Make sure that the child theme is currently active. Check this in Appearance -> Themes.
Kind Regards
Actually, it has been deactivated.
thank you it is solved and sorry for the inconvenience
The topic ‘problem with add to cart” b’ is closed to new replies.