WordPress at Your Fingertips
function is not described

Automattic\WooCommerce\Blocks\StoreApi\Schemas

ProductSchema::get_remaining_stock() protected WC 1.0

Gets remaining stock amount for a product.

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

No Hooks.

Return

Int|null.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_remaining_stock( $product );
$product(WC_Product) (required)
Product instance.

Code of ProductSchema::get_remaining_stock() WC 5.6.0

protected function get_remaining_stock( \WC_Product $product ) {
	if ( is_null( $product->get_stock_quantity() ) ) {
		return null;
	}
	return $product->get_stock_quantity();
}