WC_Product::has_enough_stock( mixed $quantity )

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


Description Description


Parameters Parameters

$quantity

(Required) Quantity of a product added to an order.


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/abstracts/abstract-wc-product.php

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


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.