WooCommerce Code Reference

InvalidStockLevelsInCartException extends Exception
in package

InvalidStockLevelsInCartException class.

This exception is thrown if any items are out of stock after each product on a draft order has been stock checked.

Table of Contents

$additional_data  : array<string|int, mixed>
Additional error data.
$error  : WP_Error
All errors to display to the user.
$error_code  : string
Sanitized error code.
__construct()  : mixed
Setup exception.
getAdditionalData()  : array<string|int, mixed>
Returns additional error data.
getError()  : WP_Error
Returns the list of messages.
getErrorCode()  : string
Returns the error code.

Properties

Methods

__construct()

Setup exception.

public __construct(string $error_code, WP_Error $error[, array<string|int, mixed> $additional_data = [] ]) : mixed
Parameters
$error_code : string

Machine-readable error code, e.g woocommerce_invalid_product_id.

$error : WP_Error

The WP_Error object containing all errors relating to stock availability.

$additional_data : array<string|int, mixed> = []

Extra data (key value pairs) to expose in the error response.

Return values
mixed