Minimum Items in Cart for Checkout
There is Ubercart Product Minimum &amp; Maximum


  Adds minimum, maximum and order in multiples limits on products.
  Checks that the quantity selected matches the limits during both Add
  To Cart and Checkout actions. Quantity checks are disabled when
  product is added to the cart as part of a product kit.


If you want to do it with code this is one way to do that.

You can make use of hook_add_to_cart to get the product add event. 

To get the number of items use uc_cart_get_contents

The ides is 

function &lt;modulename&gt;_add_to_cart($nid, $qty, $data) {
  $items = uc_cart_get_contents();
// Display a message if the cart has more than 5 products.
  $item_count = count($items);
  if ($item_count &lt; 5) {
    drupal_set_message('Your cart Should contains more than 5 products to checkout !');
    // drupal_goto to product listing page
  }
  return $result;
}