WC_Product_CSV_Importer::parse_tax_status_field()publicWC 1.0

Parse the tax status field.

Method of the class: WC_Product_CSV_Importer{}

No Hooks.

Return

String.

Usage

$WC_Product_CSV_Importer = new WC_Product_CSV_Importer();
$WC_Product_CSV_Importer->parse_tax_status_field( $value );
$value(string) (required)
Field value.

WC_Product_CSV_Importer::parse_tax_status_field() code WC 8.9.0

public function parse_tax_status_field( $value ) {
	if ( '' === $value ) {
		return $value;
	}

	// Remove the ' prepended to fields that start with - if needed.
	$value = $this->unescape_data( $value );

	if ( 'true' === strtolower( $value ) || 'false' === strtolower( $value ) ) {
		$value = wc_string_to_bool( $value ) ? 'taxable' : 'none';
	}

	return wc_clean( $value );
}