My Woocommerce website isn't redirecting to cart or checkout page anymore

2.1k Views Asked by At

our website is running at koh samui tours. All was working fine until this morning, when all of a sudden we don't get any bookings through Woocommerce bookings anymore. It seems that the button 'Book now' on a product page is not sending the customer to the checkout page, but just reloads the current page.

My console isn't showing anything weird, and error logs show nothing strange. I am really lost, can anyone help me to see what's going on?

2

There are 2 best solutions below

1
On BEST ANSWER

just be sure that this option is ticked:

WP admin panel > WooCommerce >products > display

find the option that says redirect to the cart page after successful addition and tick it
Steps for redirecting user to cart in WooCommerce

0
On

Add this code in functions.php and try.

add_filter ('add_to_cart_redirect', 'redirect_to_checkout');

function redirect_to_checkout() {
   global $woocommerce;
   $checkout_url = $woocommerce->cart->get_checkout_url();
   return $checkout_url;
}