function inStock($skus){
if ($skus->getSize()) {
$skusArray = array();
foreach ($skus as $sku) {
$skusArray[] = $sku->getSku();
$requiredQtyArray[$sku->getSku()] = $sku->getSku();
}
$collection = Mage::getModel('catalog/product')
->getCollection()
->addAttributeToFilter('sku', array('in' => $skusArray));
foreach ($collection as $product) {
$quantity = Mage::getModel('cataloginventory/stock_item')->loadByProduct($product)->getQty();
if ($quantity < $skurequiredQtyArray[$product->getRequiredQuantity>getSku()]) {
return false;
}
}
} else {
return false;
}
return true;
}