WordPress filter hook
woocommerce_checkout_customer_id
Defined by WooCommerce and fired by 21 plugins in total, running on 7M+ sites between them.
“Provides an opportunity to modify the customer ID associated with the current checkout process.”
How to use woocommerce_checkout_customer_id
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_checkout_customer_id', function( $value ) {
// Change $value here.
return $value;
}, 10, 1 );Argument names come from Greenpay Payment Gateway's source. Other plugins may pass different values: check the call in the plugin you're targeting below.
21 plugins that fire woocommerce_checkout_customer_id
Sorted by active installs. Each entry shows where the plugin calls the hook and what it passes.
-
WooCommerce7+ million installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )includes/class-wc-checkout.php:191 -
Product Labels, Quick View, Buy Now, Pre-Orders, Frequently Bought Together & More for WooCommerce8,000+ installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )inc/modules/pre-orders/class-pre-orders-main-functionality.php:563 -
NP Quote Request for WooCommerce8,000+ installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )includes/classes/gpls_woo_rfq_functions.php:1472 -
Deposits & Partial Payments for WooCommerce5,000+ installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )includes/class-awcdp-front-end.php:1763 -
Pay with Vipps and MobilePay for WooCommerce5,000+ installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )payment/WC_Gateway_Vipps.class.php:3966 -
AliNext4,000+ installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )includes/classes/controller/FrontendInitController.php:272 -
Address Book for WooCommerce3,000+ installs
apply_filters( 'woocommerce_checkout_customer_id', current_user_id( 'woocommerce_checkout_update_customer_data' ) )includes/address-book.php:360 -
Sezzle Woocommerce Payment1,000+ installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )includes/class-sezzle-checkout.php:166 -
Constant Contact + WooCommerce1,000+ installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )src/Utility/CheckoutBlockNewsletter.php:135 -
Novalnet Payment Gateway for WooCommerce1,000+ installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )class-wc-novalnet.php:1086 -
워드프레스 결제 심플페이900+ installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )includes/class-pafw-simple-pay.php:106 -
Greenpay Payment Gateway100+ installs
apply_filters( 'woocommerce_checkout_customer_id', $user_id ?? '' )includes/class-gateway-greenpay.php:922 -
Diller Loyalty90+ installs
apply_filters( 'woocommerce_checkout_customer_id', $follower->get_wp_user_id() )includes/class-diller-loyalty-woocommerce.php:1508 -
DEPART20+ installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )inc/deposit-block.php:141 -
Hygglig Checkout10+ installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )classes/class-hygglig-checkout.php:673 -
Long Term Interest-Free by HummGroup, New Zealand for WooCommerce10+ installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )includes/flexicardsltfo_gateway.php:371 -
Briqpay for WooCommerce10+ installs
apply_filters( 'woocommerce_checkout_customer_id', $customer_id )includes/class-checkout-handler.php:3022 -
GreenPay Payment Service10+ installs
apply_filters( 'woocommerce_checkout_customer_id', $user_id ?? '' )includes/class-gateway-greenpay.php:1352 -
TogetherPay for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )class/WC_Gateway_SplitOff.php:1888 -
Paydock for WooCommerceFewer than 10 installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )includes/Helpers/OrderHelper.php:40 -
Official Viapay Checkout GatewayFewer than 10 installs
apply_filters( 'woocommerce_checkout_customer_id', get_current_user_id() )includes/class-wc-viapay-order-statuses.php:206
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.