Automattic\WooCommerce\Internal\Admin\WCPayPromotion

Init::can_show_promotion()public staticWC 1.0

Checks if promoted gateway can be registered.

Method of the class: Init{}

Return

true|false. if promoted gateway should be registered.

Usage

$result = Init::can_show_promotion();

Init::can_show_promotion() code WC 7.1.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;
}