Automattic\WooCommerce\Internal\Admin\Suggestions

PaymentsExtensionSuggestionIncentives::is_incentive_visible │ public │ WC 1.0

Check if an incentive is visible.

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

Хуков нет.

Возвращает

bool. Whether there is a visible incentive for the suggestion.

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

$PaymentsExtensionSuggestionIncentives = new PaymentsExtensionSuggestionIncentives();
$PaymentsExtensionSuggestionIncentives->is_incentive_visible( $incentive_id, $suggestion_id, $country_code, $skip_extension_active_check ): bool;
$incentive_id(строка) (обязательный)
The incentive ID.
$suggestion_id(строка) (обязательный)
The suggestion ID this incentive is for.
$country_code(строка) (обязательный)
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.
По умолчанию: false

Код PaymentsExtensionSuggestionIncentives::is_incentive_visible() WC 11.3.0

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 );
}