WC_Order_Item_Product::set_tax_class()publicWC 1.0

Set tax class.

Method of the class: WC_Order_Item_Product{}

No Hooks.

Return

null. Nothing (null).

Usage

$WC_Order_Item_Product = new WC_Order_Item_Product();
$WC_Order_Item_Product->set_tax_class( $value );
$value(string) (required)
Tax class.

WC_Order_Item_Product::set_tax_class() code WC 8.7.0

public function set_tax_class( $value ) {
	if ( $value && ! in_array( $value, WC_Tax::get_tax_class_slugs(), true ) ) {
		$this->error( 'order_item_product_invalid_tax_class', __( 'Invalid tax class', 'woocommerce' ) );
	}
	$this->set_prop( 'tax_class', $value );
}