Automattic\WooCommerce\Internal\Admin
WcPayWelcomePage::has_incentive()
Check if we have an incentive available to show.
Method of the class: WcPayWelcomePage{}
Hooks from the method
Return
true|false
. Whether we have an incentive available to show.
Usage
$WcPayWelcomePage = new WcPayWelcomePage(); $WcPayWelcomePage->has_incentive( $skip_wcpay_active ): bool;
- $skip_wcpay_active(true|false)
- Whether to skip the check for the WooPayments plugin being active.
Default: false
WcPayWelcomePage::has_incentive() WcPayWelcomePage::has incentive code WC 9.6.0
public function has_incentive( bool $skip_wcpay_active = false ): bool { // The WooPayments plugin must not be active. if ( ! $skip_wcpay_active && $this->is_wcpay_active() ) { return false; } // Suggestions not disabled via a setting. if ( get_option( 'woocommerce_show_marketplace_suggestions', 'yes' ) === 'no' ) { return false; } /** * Filter allow marketplace suggestions. * * User can disable all suggestions via filter. * * @since 3.6.0 */ if ( ! apply_filters( 'woocommerce_allow_marketplace_suggestions', true ) ) { return false; } $incentive = $this->get_incentive(); if ( empty( $incentive ) ) { return false; } if ( $this->is_incentive_dismissed( $incentive ) ) { return false; } return $this->suggestion_incentives->is_incentive_visible( $incentive['id'], PaymentExtensionSuggestions::WOOPAYMENTS, WC()->countries->get_base_country(), $skip_wcpay_active ); }