WordPress at Your Fingertips
function is not described

WC_Product::get_max_purchase_quantity() public WC 3.0.0

Get max quantity which can be purchased at once.

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

No Hooks.

Return

Int. Quantity or -1 if unlimited.

Usage

$WC_Product = new WC_Product();
$WC_Product->get_max_purchase_quantity();

Changelog

Since 3.0.0 Introduced.

Code of WC_Product::get_max_purchase_quantity() WC 5.8.0

public function get_max_purchase_quantity() {
	return $this->is_sold_individually() ? 1 : ( $this->backorders_allowed() || ! $this->managing_stock() ? -1 : $this->get_stock_quantity() );
}