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
$additional_data
Additional error data.
public
array<string|int, mixed>
$additional_data
= []
$error
All errors to display to the user.
public
WP_Error
$error
$error_code
Sanitized error code.
public
string
$error_code
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 —getAdditionalData()
Returns additional error data.
public
getAdditionalData() : array<string|int, mixed>
Return values
array<string|int, mixed> —getError()
Returns the list of messages.
public
getError() : WP_Error
Return values
WP_Error —getErrorCode()
Returns the error code.
public
getErrorCode() : string