WC_Product::is_on_backorder()
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() WC Product::is on backorder code WC 9.8.2
public function is_on_backorder( $qty_in_cart = 0 ) { if ( ProductStockStatus::ON_BACKORDER === $this->get_stock_status() ) { return true; } return $this->managing_stock() && $this->backorders_allowed() && ( $this->get_stock_quantity() - $qty_in_cart ) < 0; }