Automattic\WooCommerce\StoreApi\Exceptions
InvalidCartException::__construct()
Setup exception.
Method of the class: InvalidCartException{}
No Hooks.
Return
null
. Nothing (null).
Usage
$InvalidCartException = new InvalidCartException(); $InvalidCartException->__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.
- $additional_data(array)
- Extra data (key value pairs) to expose in the error response.
Default: []
InvalidCartException::__construct() InvalidCartException:: construct code WC 9.2.3
public function __construct( $error_code, WP_Error $error, $additional_data = [] ) { $this->error_code = $error_code; $this->error = $error; $this->additional_data = array_filter( (array) $additional_data ); parent::__construct( '', 409 ); }