WC_Product_CSV_Importer::parse_backorders_field()publicWC 1.0

Parse backorders from a CSV.

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_backorders_field( $value );
$value(string) (required)
Field value.

WC_Product_CSV_Importer::parse_backorders_field() code WC 9.0.1

public function parse_backorders_field( $value ) {
	if ( empty( $value ) ) {
		return 'no';
	}

	$value = $this->parse_bool_field( $value );

	if ( 'notify' === $value ) {
		return 'notify';
	} elseif ( is_bool( $value ) ) {
		return $value ? 'yes' : 'no';
	}

	return 'no';
}