In Item.php file in app/code/core/Mage/CatalogInventory/Model/Stock/ there is the function
checkQuoteItemQty($qty, $summaryQty, $origQty = 0) ...
What is different in qty parameter and summaryQty parameter.
If you check the function itself, you will find the description of the parameters just above the function.
/**
* Checking quote item quantity
*
* Second parameter of this method specifies quantity of this product in whole shopping cart
* which should be checked for stock availability
*
* @param mixed $qty quantity of this item (item qty x parent item qty)
* @param mixed $summaryQty quantity of this product
* @param mixed $origQty original qty of item (not multiplied on parent item qty)
* @return Varien_Object
*/
So, here $summaryQty
is the total number of current product in whole cart. It will consist of all the instances of current product in different parent products.
Suppose you have a simple product added in multiple parent products like in configurable product, in bundle product or in grouped product and a customer buys one from configurable product and one from bundle product, $summaryQty
will be the quantity of current simple product from both the parent products.
If the value of $summaryQty
exceeds total number of available quantity of the product, it will display error message by below code
if (!$this->checkQty($summaryQty) || !$this->checkQty($qty)) {
$message = Mage::helper('cataloginventory')->__('The requested quantity for "%s" is not available.', $this->getProductName());
$result->setHasError(true)
->setMessage($message)
->setQuoteMessage($message)
->setQuoteMessageIndex('qty');
return $result;
}