woocommerce_update_cart_validation

woocommerce_update_cart_validation

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.9.8.1

apply_filters('woocommerce_update_cart_validation') is found 1 times:

  • /includes/class-wc-form-handler.php line 715
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
        continue;
    }
     
    // Update cart validation.
    $passed_validation = apply_filters( 'woocommerce_update_cart_validation', true, $cart_item_key, $values, $quantity );
     
    // is_sold_individually.
    if ( $_product->is_sold_individually() && $quantity > 1 ) {
        /* Translators: %s Product title. */
        wc_add_notice( sprintf( __( 'You can only have 1 %s in your cart.', 'woocommerce' ), $_product->get_name() ), 'error' );
        $passed_validation = false;