Woocommerce – Redireciona para o checkout depois de adicionar ao carrinho

with Sem comentários

Redirect to checkout page after add to cart

To improve the sales conversions , automatically redirecting to checkout page after adding product to cart is a cool move. To auto redirect customers to checkout when they add products to cart, use the following code:

function add_to_cart_checkout_redirect() {
wp_safe_redirect( get_permalink( get_option( 'woocommerce_checkout_page_id' ) ) );
die();
}
add_action( 'woocommerce_add_to_cart', 'add_to_cart_checkout_redirect', 16 );