Automattic\WooCommerce\StoreApi\Utilities
CartController::throw_default_product_exception()
Default exception thrown when an item cannot be added to the cart.
Метод класса: CartController{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->throw_default_product_exception( $product );
- $product(\WC_Product) (обязательный)
- Product object associated with the cart item.
Код CartController::throw_default_product_exception() CartController::throw default product exception WC 7.5.1
protected function throw_default_product_exception( \WC_Product $product ) { throw new RouteException( 'woocommerce_rest_product_not_purchasable', sprintf( /* translators: %s: product name */ __( '"%s" is not available for purchase.', 'woocommerce' ), $product->get_name() ), 400 ); }