woocommerce_variable_product_taxes_influence_price
Deprecated since since 11.3.0 after read_price_data method optimization renders this filter obsolete. It is no longer supported and may be removed in future releases. It is recommended to replace this hook with the same one.
Filters whether taxes influence the displayed price of a variable product.
Return true from this filter to force separate cache entries for the two variants. This is needed when an extension produces displayed prices that differ from raw prices independently of the standard tax calculation, for example when computing per-country prices for locations that have no configured tax rates.
Usage
add_filter( 'woocommerce_variable_product_taxes_influence_price', 'wp_kama_woocommerce_variable_product_taxes_influence_price_filter', 10, 2 );
/**
* Function for `woocommerce_variable_product_taxes_influence_price` filter-hook.
*
* @param bool $taxes_influence_price Default decision based on product taxability and configured
* tax rates.
* @param WC_Product $product The variable product being evaluated.
*
* @return bool
*/
function wp_kama_woocommerce_variable_product_taxes_influence_price_filter( $taxes_influence_price, $product ){
// filter...
return $taxes_influence_price;
}
- $taxes_influence_price(true|false)
- Default decision based on product taxability and configured tax rates.
- $product(WC_Product)
- The variable product being evaluated.
Changelog
| Since 10.9.0 | Introduced. | |
| Deprecated | Since 11.3.0 | after read_price_data method optimization renders this filter obsolete |
Where the hook is called
woocommerce_variable_product_taxes_influence_price
woocommerce/includes/data-stores/class-wc-product-variable-data-store-cpt.php 642
return (bool) apply_filters_deprecated( 'woocommerce_variable_product_taxes_influence_price', array( $taxes_influence_price, $product ), '11.3.0' );