WordPress filter hook
woocommerce_get_checkout_url
Defined by WooCommerce and fired by 11 plugins in total, running on 7M+ sites between them.
How to use woocommerce_get_checkout_url
It's a filter: your callback receives the value, and must return the (changed) value.
Add this to your theme's functions.php or a small custom plugin:
add_filter( 'woocommerce_get_checkout_url', function( $checkout_url ) {
// Change $checkout_url here.
return $checkout_url;
}, 10, 1 );Argument names come from WooCommerce's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
11 plugins that fire woocommerce_get_checkout_url
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_get_checkout_url', $checkout_url )includes/wc-core-functions.php:1455 -
Freesoul Deactivate Plugins8,000+ installs
apply_filters( 'woocommerce_get_checkout_url', $checkout_url )inc/fdp-woocommerce.php:187 -
Multi-Step Checkout for WooCommerce7,000+ installs
apply_filters( 'woocommerce_get_checkout_url', version_compare( '2.5', WC()->version, '<=' ) ? wc_get_checkout_url() : WC()->cart->get_checkout_url() )includes/form-checkout.php:55 -
One page checkout and layouts for woocommerce3,000+ installs
apply_filters( 'woocommerce_get_checkout_url', wc_get_checkout_url() )WooCommerce/checkout/form-checkout.php:35 -
Yandex pay100+ installs
apply_filters( 'woocommerce_get_checkout_url', wc_get_checkout_url() )includes/payment-methods/class-wc-ypay-method-best2pay.php:33 -
WPYAA’s Alipay Wechat(微信 支付宝) for WooCommerce50+ installs
apply_filters( 'woocommerce_get_checkout_url', $checkout_url )wc-patch.php:39 -
PatSaTECH’s Opayo Direct Gateway for WooCommerce30+ installs
apply_filters( 'woocommerce_get_checkout_url', wc_get_checkout_url() )sagepaydirect.php:881 -
One Page Checkout for WooCommerce30+ installs
apply_filters( 'woocommerce_get_checkout_url', wc_get_checkout_url() )public/templates/checkout/form-checkout.php:29 -
Paygine payment20+ installs
apply_filters( 'woocommerce_get_checkout_url', wc_get_checkout_url() )includes/class-wc-gateway-paygine.php:619 -
Best2Pay payment10+ installs
apply_filters( 'woocommerce_get_checkout_url', wc_get_checkout_url() )includes/class-wc-gateway-best2pay.php:619 -
TSF Multistep Checkout for WooCommerce10+ installs
apply_filters( 'woocommerce_get_checkout_url', WC()->cart->get_checkout_url() )woocommerce/checkout/form-checkout.php:25
Need a customisation built on this hook?
Tell us what you want to change and which plugin it's for. We'll write it, test it and send it back as a small plugin.