woocommerce_check_cart_items хук-событиеWC 3.0.0

Provides an opportunity to check cart items before checkout. This generally occurs during checkout validation.

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

add_action( 'woocommerce_check_cart_items', 'wp_kama_woocommerce_check_cart_items_action' );

/**
 * Function for `woocommerce_check_cart_items` action-hook.
 * 
 * @return void
 */
function wp_kama_woocommerce_check_cart_items_action(){

	// action...
}

Список изменений

С версии 3.0.0 Введена.
С версии 3.0.0 or earlier

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

WC_Checkout::check_cart_items()
woocommerce_check_cart_items
CartController::validate_cart()
woocommerce_check_cart_items
WC_Shortcode_Cart::output()
woocommerce_check_cart_items
WC_Shortcode_Checkout::checkout()
woocommerce_check_cart_items
woocommerce/includes/class-wc-checkout.php 328
do_action( 'woocommerce_check_cart_items' );
woocommerce/src/StoreApi/Utilities/CartController.php 457
do_action( 'woocommerce_check_cart_items' );
woocommerce/includes/shortcodes/class-wc-shortcode-cart.php 93
do_action( 'woocommerce_check_cart_items' );

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

woocommerce/includes/class-wc-cart.php 111
add_action( 'woocommerce_check_cart_items', array( $this, 'check_cart_items' ), 1 );
woocommerce/includes/class-wc-cart.php 112
add_action( 'woocommerce_check_cart_items', array( $this, 'check_cart_coupons' ), 1 );
woocommerce/src/StoreApi/Utilities/CartController.php 442
remove_action( 'woocommerce_check_cart_items', array( $cart, 'check_cart_items' ), 1 );
woocommerce/src/StoreApi/Utilities/CartController.php 443
remove_action( 'woocommerce_check_cart_items', array( $cart, 'check_cart_coupons' ), 1 );