Yes its possible using a simple wordpress function.
Please add following function in your theme functions.php file.
add_filter ('add_to_cart_redirect', 'redirect_checkout');
function redirect_checkout() {
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
return $checkout_url;
}
In the latest version of wordperss you also used following shot function.
function redirect_to_checkout() {
return WC()->cart->get_checkout_url();
}
Enjoy!
Please add following function in your theme functions.php file.
add_filter ('add_to_cart_redirect', 'redirect_checkout');
function redirect_checkout() {
global $woocommerce;
$checkout_url = $woocommerce->cart->get_checkout_url();
return $checkout_url;
}
In the latest version of wordperss you also used following shot function.
function redirect_to_checkout() {
return WC()->cart->get_checkout_url();
}
Enjoy!
No comments:
Post a Comment