woocommerce_check_cart_items

woocommerce_check_cart_items

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

do_action('woocommerce_check_cart_items') is found 4 times:

  • /includes/class-wc-checkout.php line 343
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
         *
         * @see WC_Checkout::validate_checkout()
         * @since 3.0.0 or earlier
         */
        do_action( 'woocommerce_check_cart_items' );
    }
     
    /**
     * Output the billing form.
     */
    public function checkout_form_billing() {
  • /includes/shortcodes/class-wc-shortcode-cart.php line 93
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
        WC()->cart->calculate_totals();
    }
     
    // Check cart items are valid.
    do_action( 'woocommerce_check_cart_items' );
     
    // Calc totals.
    WC()->cart->calculate_totals();
     
    if ( WC()->cart->is_empty() ) {
        wc_get_template( 'cart/cart-empty.php' );
  • /includes/shortcodes/class-wc-shortcode-checkout.php line 352
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
        return;
    }
     
    // Check cart contents for errors.
    do_action( 'woocommerce_check_cart_items' );
     
    // Calc totals.
    WC()->cart->calculate_totals();
     
    // Get checkout object.
    $checkout = WC()->checkout();
  • /src/StoreApi/Utilities/CartController.php line 498
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    *
     * @deprecated
     * @internal Matches action name in WooCommerce core.
     */
    do_action( 'woocommerce_check_cart_items' );
     
    $cart_errors = NoticeHandler::convert_notices_to_wp_errors( 'woocommerce_rest_cart_item_error' );
     
    // Restore notices.
    WC()->session->set( 'wc_notices', $previous_notices );

See this hook used in plugins: