WC_Product_CSV_Exporter::get_column_value_stock_status()protectedWC 3.1.0

Get stock status value.

Method of the class: WC_Product_CSV_Exporter{}

No Hooks.

Return

String.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_column_value_stock_status( $product );
$product(WC_Product) (required)
Product being exported.

Changelog

Since 3.1.0 Introduced.

WC_Product_CSV_Exporter::get_column_value_stock_status() code WC 9.4.2

protected function get_column_value_stock_status( $product ) {
	$status = $product->get_stock_status( 'edit' );

	if ( 'onbackorder' === $status ) {
		return 'backorder';
	}

	return 'instock' === $status ? 1 : 0;
}