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? 1 How to Redirect to Custom URL After User Clicks 'Proceed to Checkout' on the WooCommerce Cart Page? - Tyche Softwares](https://media.tychesoftwares.com/wp-content/uploads/Redirect-to-custom-URL-1024x827.png)
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.