woocommerce_store_api_cart_errors хук-событиеWC 1.0

Fires an action to validate the cart.

Functions hooking into this should add custom errors using the provided WP_Error instance.

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

add_action( 'woocommerce_store_api_cart_errors', 'wp_kama_woocommerce_store_api_cart_errors_action', 10, 2 );

/**
 * Function for `woocommerce_store_api_cart_errors` action-hook.
 * 
 * @param \WP_Error $errors WP_Error object.
 * @param \WC_Cart  $cart   Cart object.
 *
 * @return void
 */
function wp_kama_woocommerce_store_api_cart_errors_action( $errors, $cart ){

	// action...
}
$errors(\WP_Error)
WP_Error object.
$cart(\WC_Cart)
Cart object.

Где вызывается хук

CartController::validate_cart()
woocommerce_store_api_cart_errors
woocommerce/packages/woocommerce-blocks/src/StoreApi/Utilities/CartController.php 407
do_action( 'woocommerce_store_api_cart_errors', $cart_errors, $cart );

Где используется хук в WooCommerce

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