You can use this function to get the maximum value from a column in your cart.
function getMaxFromCart($cart,$col) {
$maxVal = 0;
while (!$cart->EOF()) {
if ($eCart1->DisplayInfo($col) > $maxVal) $maxVal = $eCart1->DisplayInfo($col);
$eCart1->MoveNext();
}
$eCart1->MoveFirst();
}