WC_Product::is_in_stock()
Returns whether or not the product can be purchased. This returns true for 'instock' and 'onbackorder' stock statuses.
Метод класса: WC_Product{}
Хуки из метода
Возвращает
true|false
.
Использование
$WC_Product = new WC_Product(); $WC_Product->is_in_stock();
Код WC_Product::is_in_stock() WC Product::is in stock WC 8.7.0
public function is_in_stock() { return apply_filters( 'woocommerce_product_is_in_stock', 'outofstock' !== $this->get_stock_status(), $this ); }