WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Платформа для конвертации и монетизации трафика
функция не описана

Automattic\WooCommerce\Blocks\Domain\Services

CreateAccount::should_create_customer_account() protected WC 1.0

Check request options and store (shop) config to determine if a user account should be created as part of order processing.

{} Это метод класса: CreateAccount{}

Хуков нет.

Возвращает

true/false. True if a new user account should be created.

Использование

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->should_create_customer_account( \WP_REST_Request $request );
$request(\WP_REST_Request) (обязательный)
The current request object being handled.

Код CreateAccount::should_create_customer_account() WC 4.7.1

<?php
protected function should_create_customer_account( \WP_REST_Request $request ) {
	if ( is_user_logged_in() ) {
		// User is already logged in - no need to create an account.
		return false;
	}

	// From here we know that the shopper is not logged in.

	if ( false === filter_var( get_option( 'woocommerce_enable_guest_checkout' ), FILTER_VALIDATE_BOOLEAN ) ) {
		// Store requires an account for all checkouts (purchases).
		// Create an account independent of shopper option in $request.
		// Note - checkbox is not displayed to shopper in this case.
		return true;
	}

	// From here we know that the store allows guest checkout;
	// shopper can choose whether they sign up (`should_create_account`).

	if ( true === filter_var( $request['should_create_account'], FILTER_VALIDATE_BOOLEAN ) ) {
		// User has requested an account as part of checkout processing.
		return true;
	}

	return false;
}