Automattic\WooCommerce\Internal\Admin\WCPayPromotion

Init::can_show_promotion()public staticWC 1.0

Checks if promoted gateway can be registered.

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

Хуки из метода

Возвращает

true|false. if promoted gateway should be registered.

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

$result = Init::can_show_promotion();

Код Init::can_show_promotion() WC 7.3.0

public static function can_show_promotion() {
	// Check if WC Pay is enabled.
	if ( class_exists( '\WC_Payments' ) ) {
		return false;
	}
	if ( get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) === 'no' ) {
		return false;
	}
	if ( ! apply_filters( 'woocommerce_allow_marketplace_suggestions', true ) ) {
		return false;
	}

	$wc_pay_spec = self::get_wc_pay_promotion_spec();
	if ( ! $wc_pay_spec ) {
		return false;
	}
	return true;
}