WordPress at Your Fingertips
function is not described


InvalidStockLevelsInCartException::__construct() public WC 1.0

Setup exception.

{} It's a method of the class: InvalidStockLevelsInCartException{}

No Hooks.


null. Nothing.


$InvalidStockLevelsInCartException = new InvalidStockLevelsInCartException();
$InvalidStockLevelsInCartException->__construct( $error_code, $error, $additional_data );
$error_code(string) (required)
Machine-readable error code, e.g woocommerce_invalid_product_id.
$error(WP_Error) (required)
The WP_Error object containing all errors relating to stock availability.
Extra data (key value pairs) to expose in the error response.
Default: []

Code of InvalidStockLevelsInCartException::__construct() WC 5.7.1

public function __construct( $error_code, $error, $additional_data = [] ) {
	$this->error_code      = $error_code;
	$this->error           = $error;
	$this->additional_data = array_filter( (array) $additional_data );
	parent::__construct( '', 409 );