WC_Cart::is_coupon_emails_allowedpublicWC 1.0

Устарела с версии 9.0.0 In favor of static method Automattic\WooCommerce\Utilities\DiscountsUtil::is_coupon_emails_allowed.. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.

Checks if the given email address(es) matches the ones specified on the coupon.

Метод класса: WC_Cart{}

Хуков нет.

Возвращает

true|false.

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

$WC_Cart = new WC_Cart();
$WC_Cart->is_coupon_emails_allowed( $check_emails, $restrictions );
$check_emails(массив) (обязательный)
Array of customer email addresses.
$restrictions(массив) (обязательный)
Array of allowed email addresses.

Список изменений

Устарела с 9.0.0 In favor of static method Automattic\WooCommerce\Utilities\DiscountsUtil::is_coupon_emails_allowed.

Код WC_Cart::is_coupon_emails_allowed() WC 9.9.3

public function is_coupon_emails_allowed( $check_emails, $restrictions ) {
	wc_doing_it_wrong(
		'WC_Cart::is_coupon_emails_allowed',
		__( 'This method has been deprecated and will be removed soon. Use Automattic\WooCommerce\Utilities\DiscountsUtil::is_coupon_emails_allowed instead.', 'woocommerce' ),
		'9.0.0'
	);

	return DiscountsUtil::is_coupon_emails_allowed( $check_emails, $restrictions );
}