The Maximum Qty Discount is Applied To field is quantity per-product. So if you have that field set to 3, and someone puts in a single product with a quantity of 5, the discount will only be applied 3 times. However, if you put in 5 products with a quantity of 5 each, it will be applied 3 times to each product.
* Return discount item qty
* @param Mage_Sales_Model_Quote_Item_Abstract $item
* @param Mage_SalesRule_Model_Rule $rule
* @return int
protected function _getItemQty($item, $rule)
$qty = $item->getTotalQty();
return $rule->getDiscountQty() ? min($qty, $rule->getDiscountQty()) : $qty;
Even adding an Action condition like this, would not work, as it would then not apply the rule at all if the customer adds more than 3.
Quantity in cart equals or less than 3
I'm not aware of a built-in way to do what you're looking to do.