Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Enums

StockStatus{}WC 1.0

No Hooks.

Usage

$StockStatus = new StockStatus();
// use class methods

Methods

  1. public static get()

StockStatus{} code WC 10.9.1

class StockStatus {
	private static ?EnumType $instance = null;

	public static function get(): EnumType {
		if ( null === self::$instance ) {
			self::$instance = new EnumType(
				array(
					'name'        => 'StockStatus',
					'description' => __( 'The stock status of a product.', 'woocommerce' ),
					'values'      => array(
						'IN_STOCK'     => array(
							'value'       => StockStatusEnum::InStock,
							'description' => __( 'The product is in stock.', 'woocommerce' ),
						),
						'OUT_OF_STOCK' => array(
							'value'       => StockStatusEnum::OutOfStock,
							'description' => __( 'The product is out of stock.', 'woocommerce' ),
						),
						'ON_BACKORDER' => array(
							'value'       => StockStatusEnum::OnBackorder,
							'description' => __( 'The product is on backorder.', 'woocommerce' ),
						),
						'OTHER'        => array(
							'value'       => StockStatusEnum::Other,
							'description' => __( 'The stock status is not one of the standard WooCommerce values (e.g. added by a plugin). Inspect raw_stock_status for the underlying value.', 'woocommerce' ),
						),
					),
				)
			);
		}
		return self::$instance;
	}
}