I have the issue that even if I restrict the maximum cart quantity for a product with custom options to 1, it still lets me add more than 1 if I choose different custom options for the product. How can I make it so the maximum quantity is always 1, no matter what custom options the customer selects?
Solved! Go to Solution.
You need to tweak the code,
find $qty > $this->getMaxSaleQty() in Mage_CatalogInventory_Model_Stock_Item, replace with $summaryQty > $this->getMaxSaleQty()
Goto admin configuration, catalog >> Manage Products >> Select your product >> Inventory >> Maximum Qty Allowed in Shopping Cart. Here, Uncheck "Use Config Settings" add filed as "1" qty. Save Configuration and check frontend.
Let me know incase of any query/concerns regarding the same.
Thanks AddWeb. Unfortunately that does not work. It is the same as if I use the config settings, where I set System > Configuration > Catalog > Inventory > Product Stock Options > Maximum Qty Allowed in Shopping Cart to "1".
It only prevents me from adding more than 1 product if I select exactly the same custom options for the second product. If one of the custom options is different , it still adds it to the cart. I would need it to not add the product if it is already in the cart, no matter what custom options are selected... I suppose I need to tweak the code somehow?
Does anyone know how I can do this?
There really should be an option in the Product Stock Options to ignore different custom options when determining whether the product is already in the cart...
Can you please elaborate the scenario you are looking towards.
I am looking to set the maximum quantity per product the customer can add to the cart to 1...
Right now, if I have a (virtual) product with custom options, even if I set the maximum quantity per product to 1 in the backend, I can still add more than 1 of the same product if I choose different custom options. It should not let me add the same product more than once, even if I choose different custom options...
That's brilliant! And so simple!
Thanks KuafuSoft, you made my day! I accepted your answer as the solution.