mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-04-29 11:32:21 +08:00
6 lines
242 B
Text
6 lines
242 B
Text
function wc_custom_add_to_cart_redirect( $url ) {
|
|
$url = WC()->cart->get_checkout_url();
|
|
// $url = wc_get_checkout_url(); // since WC 2.5.0
|
|
return $url;
|
|
}
|
|
add_filter( 'woocommerce_add_to_cart_redirect', 'wc_custom_add_to_cart_redirect' );
|