I found a method that identifies an item on stock
app/code/core/Mage/CatalogInventory/Model/Stock/Item.php
class Mage_CatalogInventory_Model_Stock_Item
public function verifyStock($qty = null)
{
if ($qty === null) {
$qty = $this->getQty();
}
if ($this->getBackorders() == Mage_CatalogInventory_Model_Stock::BACKORDERS_NO && $qty <= $this->getMinQty()) {
return false;
}
return true;
}
You can try to change it to the following:
/**
* Chceck if item should be in stock or out of stock based on $qty param of existing item qty
*
* @param float|null $qty
* @return bool true - item in stock | false - item out of stock
*/
public function verifyStock($qty = null)
{
if ($qty === null) {
$qty = $this->getQty();
}
if ($this->getBackorders() == Mage_CatalogInventory_Model_Stock::BACKORDERS_NO
&& $qty <= $this->getMinQty()) {
return false;
}
$backorderedCustomerGoupsIds = array(2, 3); // move admin to config better
if ($this->getBackorders() != Mage_CatalogInventory_Model_Stock::BACKORDERS_NO &&
!in_array($this->getCustomerGroupId(), $backorderedCustomerGoupsIds)
) {
return false;
}
return true;
}
Copy file app/code/core/Mage/CatalogInventory/Model/Stock/Item.php to
app/code/local/Mage/CatalogInventory/Model/Stock/Item.php.