Tag: woocommerce ad to cart

Woo-commerce: add to cart button redirect to checkout

Add this code in your function.php

/*
** Add to cart redirect to checkout
*/
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;
}

 

 

Advertisements