Automattic\WooCommerce\StoreApi\Exceptions

StockAvailabilityException::__construct()publicWC 1.0

Setup exception.

Метод класса: StockAvailabilityException{}

Хуков нет.

Возвращает

null. Ничего.

Использование

$StockAvailabilityException = new StockAvailabilityException();
$StockAvailabilityException->__construct( $error_code, $product_name, $additional_data );
$error_code(строка) (обязательный)
Machine-readable error code, e.g woocommerce_invalid_product_id.
$product_name(строка) (обязательный)
The name of the product that can only be purchased individually.
$additional_data(массив)
Extra data (key value pairs) to expose in the error response.
По умолчанию: []

Код StockAvailabilityException::__construct() WC 7.1.0

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