Black Friday & Cyber Monday SUPER SALE ALL WEEK:
Grab 40% OFF on plugins
Days
Hours
Minutes
Seconds

How to Redirect to Custom URL After User Clicks ‘Proceed to Checkout’ on the WooCommerce Cart Page?

This customization is implemented by store owners when some integrated payment gateways require redirection to an external page for payment processing. In such cases, this code snippet is helpful such that when user clicks ‘Proceed to checkout’ on the cart page, they will be redirected to a custom URL.

add_filter('woocommerce_get_checkout_url', 'ts_redirect_checkout');

function ts_redirect_checkout($url) {
     global $woocommerce;
     $checkout_url = 'http://your-custom-url.com';
     return  $checkout_url; 
}

Output

When user clicks on ‘Proceed to Button’ they will be redirected to the custom URL page specified in the code.

How to Redirect to Custom URL After User Clicks 'Proceed to Checkout' on the WooCommerce Cart Page? - Tyche Softwares

Instead of redirecting, you can also remove the proceed to checkout button from cart page in WooCommerce in cases of having external payment options such as Paypal in your store.

Browse more in: Code Snippets, WooCommerce How Tos, WooCommerce Tutorials

Share It:

Subscribe
Notify of
0 Comments
Newest
Oldest
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x