Do you want to redirect to woocommerce checkout directly when the user clicks on add to cart button? Then add the following hook in your theme’s functions.php file and save it.
It will redirect the user to checkout after clicking on add to cart button.
You can redirect on any page. As I used the
wc_get_checkout_url() function for the checkout page URL, so you can use any one.
Read the full article here to redirect checkout, change the button text, remove the success message, etc.