woocommerce_store_api_cart_errors
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... }
Список изменений
С версии 7.2.0 | Введена. |
Где вызывается хук
woocommerce_store_api_cart_errors
woocommerce/src/StoreApi/Utilities/CartController.php 450
do_action( 'woocommerce_store_api_cart_errors', $cart_errors, $cart );