WC_Product_Variable_Data_Store_CPT::taxes_influence_price
Check if the prices for a product will be different with or without taxes.
Method of the class: WC_Product_Variable_Data_Store_CPT{}
No Hooks.
Returns
true|false. True if the prices will be different with or without taxes.
Usage
// protected - for code of main (parent) or child class $result = $this->taxes_influence_price( $product ): bool;
- $product(WC_Product) (required)
- Product to check.
Changelog
| Since 10.4.0 | Introduced. |
WC_Product_Variable_Data_Store_CPT::taxes_influence_price() WC Product Variable Data Store CPT::taxes influence price code WC 10.5.0
protected function taxes_influence_price( $product ): bool {
if ( ! $product->is_taxable() ) {
return false;
}
if ( empty( WC_Tax::get_rates( $product->get_tax_class() ) ) ) {
return false;
}
if ( ! empty( WC()->customer ) && WC()->customer->get_is_vat_exempt() ) {
return false;
}
return true;
}