woocommerce_checkout_registration_required filter-hookWC 3.0.0

Is registration required to checkout?

Usage

add_filter( 'woocommerce_checkout_registration_required', 'wp_kama_woocommerce_checkout_registration_required_filter' );

/**
 * Function for `woocommerce_checkout_registration_required` filter-hook.
 * 
 * @param  $string 
 *
 * @return 
 */
function wp_kama_woocommerce_checkout_registration_required_filter( $string ){

	// filter...
	return $string;
}
$string
-

Changelog

Since 3.0.0 Introduced.

Where the hook is called

WC_Checkout::is_registration_required()
woocommerce_checkout_registration_required
woocommerce/includes/class-wc-checkout.php 184
return apply_filters( 'woocommerce_checkout_registration_required', 'yes' !== get_option( 'woocommerce_enable_guest_checkout' ) );

Where the hook is used in WooCommerce

woocommerce/includes/class-wc-checkout.php 112
remove_filter( 'woocommerce_checkout_registration_required', '__return_true', 0 );
woocommerce/includes/class-wc-checkout.php 113
remove_filter( 'woocommerce_checkout_registration_required', '__return_false', 0 );
woocommerce/includes/class-wc-checkout.php 114
add_filter( 'woocommerce_checkout_registration_required', $bool_value ? '__return_false' : '__return_true', 0 );