woocommerce_checkout_registration_required
Controls if registration is required in order for checkout to be completed.
Usage
add_filter( 'woocommerce_checkout_registration_required', 'wp_kama_woocommerce_checkout_registration_required_filter' );
/**
* Function for `woocommerce_checkout_registration_required` filter-hook.
*
* @param bool $checkout_registration_required If customers must be registered to checkout.
*
* @return bool
*/
function wp_kama_woocommerce_checkout_registration_required_filter( $checkout_registration_required ){
// filter...
return $checkout_registration_required;
}
- $checkout_registration_required(true|false)
- If customers must be registered to checkout.
Changelog
| Since 3.0.0 | Introduced. |
Where the hook is called
woocommerce_checkout_registration_required
woocommerce/includes/class-wc-checkout.php 207
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 121
remove_filter( 'woocommerce_checkout_registration_required', '__return_true', 0 );
woocommerce/includes/class-wc-checkout.php 122
remove_filter( 'woocommerce_checkout_registration_required', '__return_false', 0 );
woocommerce/includes/class-wc-checkout.php 123
add_filter( 'woocommerce_checkout_registration_required', $bool_value ? '__return_false' : '__return_true', 0 );