There is 2 actions to check and to control if you want to limit cart items: Add to basket - When product is added to cart Update Basket - When quantities are updated in cart page Add a custom function hooked in woocommerce_add_to_cart_validation filter hook in function.php file of your active child theme (or theme), will allow customer to restrict the cart items to 'n' max and to display a custom message when this limit is exceeded: Checking and validating when products are added to cart: Restrict Total Transaction Items: add_filter( 'woocommerce_add_to_cart_validation', 'only_n_items_allowed_add_to_cart', 10, 3 ); function only_n_items_allowed_add_to_cart( $passed, $product_id, $quantity ) { $cart_items_count = WC()->cart->get_cart_contents_count(); $total_count = $cart_items_count + $quantity; if( $cart_items_count >= n || $total_count > n ){ // Set to false $passed = false; // Display a...