Automattic\WooCommerce\Internal\Admin\WCPayPromotion
Init::can_show_promotion
Checks if promoted gateway can be registered.
Method of the class: Init{}
No Hooks.
Returns
true|false. If promoted gateway should be registered.
Usage
$result = Init::can_show_promotion();
Init::can_show_promotion() Init::can show promotion code WC 10.5.0
public static function can_show_promotion() {
// Don't show if WooPayments is enabled.
if ( class_exists( '\WC_Payments' ) ) {
return false;
}
// Don't show if there is no WooPayments promotion spec.
$wc_pay_spec = self::get_wc_pay_promotion_spec();
if ( ! $wc_pay_spec ) {
return false;
}
return true;
}