I am looking at limiting customers to buying 1 bundle product at a time.
Is there a way of setting "Maximum Qty Allowed in Shopping Cart" for a bundle product.
I want to do this without limiting the individual products, so customers can buy as many of them separately.
Any ideas if this is possible, if so how do I implement this?
Best Answer
The core feature "Maximum qty" is tied to stock items, so it does not work with bundles (they don't have their own stock).
You have to develop it on your own.
For simple products, the check happens in
Mage_CatalogInventory_Model_Stock_Item::checkQuoteItemQty()
:It's called in
Mage_CatalogInventory_Model_Observer::checkQuoteItemQty()
and this is where I would add my own additional restrictions for bundles. Either with a rewrite or with an additional observer for the same event (sales_quote_item_qty_set_after
):