WC_Product::get_stock_quantity()
Returns number of items available for sale.
Метод класса: WC_Product{}
Хуков нет.
Возвращает
int|null
.
Использование
$WC_Product = new WC_Product(); $WC_Product->get_stock_quantity( $context );
- $context(строка)
- What the value is for. Valid values are view and edit.
По умолчанию: 'view'
Код WC_Product::get_stock_quantity() WC Product::get stock quantity WC 9.6.1
public function get_stock_quantity( $context = 'view' ) { return $this->get_prop( 'stock_quantity', $context ); }