WC_Product::set_tax_status( string $status )
Set the tax status.
Description Description
Parameters Parameters
- $status
-
(Required) Tax status.
Source Source
File: includes/abstracts/abstract-wc-product.php
public function set_tax_status( $status ) {
$options = array(
'taxable',
'shipping',
'none',
);
// Set default if empty.
if ( empty( $status ) ) {
$status = 'taxable';
}
if ( ! in_array( $status, $options, true ) ) {
$this->error( 'product_invalid_tax_status', __( 'Invalid product tax status.', 'woocommerce' ) );
}
$this->set_prop( 'tax_status', $status );
}
Changelog Changelog
| Version | Description |
|---|---|
| 3.0.0 | Introduced. |