cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict product quantity regardless of custom options

SOLVED
   Did you know you can see the translated content as per your choice?

Translation is in progress. Please check again after few minutes.

Restrict product quantity regardless of custom options

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?

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Restrict product quantity regardless of custom options

You need to tweak the code,

find $qty > $this->getMaxSaleQty() in Mage_CatalogInventory_Model_Stock_Item, replace with $summaryQty > $this->getMaxSaleQty()

View solution in original post

7 REPLIES 7

Re: Restrict product quantity regardless of custom options

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.

Query solved? Accept as Solution.Thanks
Eric Baily

Re: Restrict product quantity regardless of custom options

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?

Re: Restrict product quantity regardless of custom options

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...

Re: Restrict product quantity regardless of custom options

@LordClick

 

Can you please elaborate the scenario you are looking towards.

Query solved? Accept as Solution.Thanks
Eric Baily

Re: Restrict product quantity regardless of custom options

@AddWebSolution

 

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...

Re: Restrict product quantity regardless of custom options

You need to tweak the code,

find $qty > $this->getMaxSaleQty() in Mage_CatalogInventory_Model_Stock_Item, replace with $summaryQty > $this->getMaxSaleQty()

Re: Restrict product quantity regardless of custom options

@KuafuSoft

 

That's brilliant! And so simple!

 

Thanks KuafuSoft, you made my day! Smiley Happy I accepted your answer as the solution.