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:

functions.php
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.

  1. WooCommerce icon WooCommerce7+ million installs apply_filters( 'woocommerce_get_checkout_url', $checkout_url ) includes/wc-core-functions.php:1455
  2. Freesoul Deactivate Plugins icon Freesoul Deactivate Plugins8,000+ installs apply_filters( 'woocommerce_get_checkout_url', $checkout_url ) inc/fdp-woocommerce.php:187
  3. Multi-Step Checkout for WooCommerce icon 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
  4. One page checkout and layouts for woocommerce icon 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
  5. Yandex pay icon Yandex pay100+ installs apply_filters( 'woocommerce_get_checkout_url', wc_get_checkout_url() ) includes/payment-methods/class-wc-ypay-method-best2pay.php:33
  6. WPYAA’s Alipay Wechat(微信 支付宝) for WooCommerce icon WPYAA’s Alipay Wechat(微信 支付宝) for WooCommerce50+ installs apply_filters( 'woocommerce_get_checkout_url', $checkout_url ) wc-patch.php:39
  7. PatSaTECH’s Opayo Direct Gateway for WooCommerce icon PatSaTECH’s Opayo Direct Gateway for WooCommerce30+ installs apply_filters( 'woocommerce_get_checkout_url', wc_get_checkout_url() ) sagepaydirect.php:881
  8. One Page Checkout for WooCommerce icon One Page Checkout for WooCommerce30+ installs apply_filters( 'woocommerce_get_checkout_url', wc_get_checkout_url() ) public/templates/checkout/form-checkout.php:29
  9. Paygine payment icon Paygine payment20+ installs apply_filters( 'woocommerce_get_checkout_url', wc_get_checkout_url() ) includes/class-wc-gateway-paygine.php:619
  10. Best2Pay payment icon Best2Pay payment10+ installs apply_filters( 'woocommerce_get_checkout_url', wc_get_checkout_url() ) includes/class-wc-gateway-best2pay.php:619
  11. TSF Multistep Checkout for WooCommerce icon 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.