Automattic\WooCommerce\StoreApi\Schemas\V1
ProductSchema::get_remaining_stock()
Gets remaining stock amount for a product.
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.
ProductSchema::get_remaining_stock() ProductSchema::get remaining stock code WC 9.2.3
protected function get_remaining_stock( \WC_Product $product ) { if ( is_null( $product->get_stock_quantity() ) ) { return null; } return $product->get_stock_quantity(); }