WC_Product::is_in_stock() – Returns whether or not the product can be purchased.

You appear to be a bot. Output may be restricted

Description

Returns whether or not the product can be purchased.

This returns true for 'instock' and 'onbackorder' stock statuses.

Usage

$bool = WC_Product::is_in_stock();

Parameters

Returns

bool

Source

File name: woocommerce/includes/abstracts/abstract-wc-product.php
Lines:

1 to 3 of 3
  public function is_in_stock() {
    return apply_filters( 'woocommerce_product_is_in_stock', 'outofstock' !== $this->get_stock_status(), $this );
  }
 

 View on GitHub View on Trac