WC_Product::is_on_backorder()publicWC 1.0

Check if a product is on backorder.

Method of the class: WC_Product{}

No Hooks.

Return

true|false.

Usage

$WC_Product = new WC_Product();
$WC_Product->is_on_backorder( $qty_in_cart );
$qty_in_cart(int)
-
Default: 0)

WC_Product::is_on_backorder() code WC 8.6.1

public function is_on_backorder( $qty_in_cart = 0 ) {
	if ( 'onbackorder' === $this->get_stock_status() ) {
		return true;
	}

	return $this->managing_stock() && $this->backorders_allowed() && ( $this->get_stock_quantity() - $qty_in_cart ) < 0;
}