This quick guide shows you how you can redirect your customers to the checkout after they immediately add a product to their cart from the product archive page. This sort of process would be tailored only to a few stores where perhaps only one product can be bought at a time.
/**
* Snippet Name: Redirect users to the checkout page when they add a product to cart on the single product page
* Snippet Author: ecommercehints.com
*/
add_filter( 'woocommerce_add_to_cart_redirect', 'ecommercehints_add_to_cart_checkout_redirect' );
function ecommercehints_add_to_cart_checkout_redirect() {
return wc_get_checkout_url();
}