Automattic\WooCommerce\Internal\Admin\Suggestions

PaymentsExtensionSuggestionIncentives::is_incentive_visiblepublicWC 1.0

Check if an incentive is visible.

Method of the class: PaymentsExtensionSuggestionIncentives{}

No Hooks.

Returns

true|false. Whether there is a visible incentive for the suggestion.

Usage

$PaymentsExtensionSuggestionIncentives = new PaymentsExtensionSuggestionIncentives();
$PaymentsExtensionSuggestionIncentives->is_incentive_visible( $incentive_id, $suggestion_id, $country_code, $skip_extension_active_check ): bool;
$incentive_id(string) (required)
The incentive ID.
$suggestion_id(string) (required)
The suggestion ID this incentive is for.
$country_code(string) (required)
The business location country code to get incentives for.
$skip_extension_active_check(true|false)
Whether to skip the check for the extension plugin being active.
Default: false

PaymentsExtensionSuggestionIncentives::is_incentive_visible() code WC 10.3.3

public function is_incentive_visible(
	string $incentive_id,
	string $suggestion_id,
	string $country_code,
	bool $skip_extension_active_check = false
): bool {
	$provider = $this->get_incentive_instance( $suggestion_id );
	if ( null === $provider ) {
		return false;
	}

	return $provider->is_visible( $incentive_id, $country_code, $skip_extension_active_check );
}