If a product has attributes and is configured with restrict qty, the buyer is still able to add one item to the cart per-attribute option. I'm pretty sure this is not the behavior most would expect, and this patch resolves the issue by keeping only the most recently added version of the product.

Note that this is different than #710912: Attribute based restriction in that that issue is a feature request to have per-attribute restrictions. (Although comment #3 on that thread raises this bug.)

CommentFileSizeAuthor
uc_restrict_qty_attributes.patch889 bytesmcarbone

Comments

Anonymous’s picture

Patched worked great for me. Thank you!

hanoii’s picture

Status: Needs review » Needs work

Although the patch might work, I feel this is more a workaround than a fix. Eventually the prevention of adding the product should work properly.

I believe this actual issue won't be one on 2.x, can you check that @mcarbone ?

korayal’s picture

In my opinion there should be an extra setting in the product feature edit page.

There is an "any" option in the SKU, there should also be an "all" or "total" setting which can help us to restrict total number of a specific product id, no matter what attribute it has.

When I want to sell maximum 3 tshirts to each customer, I want them to be able to buy 1 medium and 2 small, or 3 Large or 1 medium 1 small and 1 large etc. in the same cart.

killtheliterate’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev

Is there a patch available for 6.x-2.x, or has this been remedied?

goose2000’s picture

Wanted to thank mcarbone, got the patch working with the last dev version, it works as described. Might have been nicer to display the warning message in his condition to alert the user what is happening.

dunx’s picture

Issue summary: View changes

Another +1 for this patch against v1.1.

raulmuroc’s picture

Status: Needs work » Closed (fixed)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).