WC_Admin_Setup_Wizard::should_show_automated_tax()protectedWC 1.0

Устарела с версии 4.6.0. Больше не поддерживается и может быть удалена. Рекомендуется заменить эту функцию на аналог.

The "automated tax" extra should only be shown if the current user can install plugins and the store is in a supported country.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->should_show_automated_tax();

Список изменений

Устарела с 4.6.0

Код WC_Admin_Setup_Wizard::should_show_automated_tax() WC 8.7.0

protected function should_show_automated_tax() {
	_deprecated_function( __CLASS__ . '::' . __FUNCTION__, '4.6.0', 'Onboarding is maintained in WooCommerce Admin.' );
	if ( ! current_user_can( 'install_plugins' ) ) {
		return false;
	}

	$country_code = WC()->countries->get_base_country();
	// https://developers.taxjar.com/api/reference/#countries .
	$tax_supported_countries = array_merge(
		array( 'US', 'CA', 'AU', 'GB' ),
		WC()->countries->get_european_union_countries()
	);

	return in_array( $country_code, $tax_supported_countries, true );
}