WC_Cart::is_coupon_emails_allowed()publicWC 1.0

Deprecated from version 9.0.0 In favor of static method Automattic\WooCommerce\Utilities\DiscountsUtil::is_coupon_emails_allowed.. It is no longer supported and can be removed in future releases. It is recommended to replace this function with the same one.

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

Method of the class: WC_Cart{}

No Hooks.

Return

true|false.

Usage

$WC_Cart = new WC_Cart();
$WC_Cart->is_coupon_emails_allowed( $check_emails, $restrictions );
$check_emails(array) (required)
Array of customer email addresses.
$restrictions(array) (required)
Array of allowed email addresses.

Changelog

Deprecated since 9.0.0 In favor of static method Automattic\WooCommerce\Utilities\DiscountsUtil::is_coupon_emails_allowed.

WC_Cart::is_coupon_emails_allowed() code WC 9.7.1

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 );
}