woocommerce_product_is_taxable хук-фильтрWC 2.7.0

Filters whether a product is taxable.

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

add_filter( 'woocommerce_product_is_taxable', 'wp_kama_woocommerce_product_is_taxable_filter', 10, 2 );

/**
 * Function for `woocommerce_product_is_taxable` filter-hook.
 * 
 * @param bool       $taxable Whether the product is taxable.
 * @param WC_Product $product Product object.
 *
 * @return bool
 */
function wp_kama_woocommerce_product_is_taxable_filter( $taxable, $product ){

	// filter...
	return $taxable;
}
$taxable(true|false)
Whether the product is taxable.
$product(WC_Product)
Product object.

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

С версии 2.7.0 Введена.

Где вызывается хук

WC_Product::is_taxable()
woocommerce_product_is_taxable
woocommerce/includes/abstracts/abstract-wc-product.php 1783
return apply_filters( 'woocommerce_product_is_taxable', $this->get_tax_status() === ProductTaxStatus::TAXABLE && wc_tax_enabled(), $this );

Где используется хук в WooCommerce

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