WordPress at Your Fingertips
function is not described

WC_Product::has_enough_stock() public WC 1.0

Returns whether or not the product has enough stock for the order.

{} It's a method of the class: WC_Product{}

No Hooks.

Return

true|false.

Usage

$WC_Product = new WC_Product();
$WC_Product->has_enough_stock( $quantity );
$quantity(mixed) (required)
Quantity of a product added to an order.

Code of WC_Product::has_enough_stock() WC 5.5.2

<?php
public function has_enough_stock( $quantity ) {
	return ! $this->managing_stock() || $this->backorders_allowed() || $this->get_stock_quantity() >= $quantity;
}