biddyweb / substruct

Automatically exported from code.google.com/p/substruct
0 stars 0 forks source link

Negative quantities may be entered #154

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Navigate to a product page
2. Enter a negative quantity under "How many do you want?"
3. Click "Add to Cart"

What is the expected output? What do you see instead?
A negative quantity should be subtracted from the item's current quantity in 
the cart, and a 
negative number of units should never be saved in the cart.

In the current version, entering a negative number results in a negative unit 
count, and therefore 
a negative cart total.

What version of the product are you using? On what operating system?
r163

Original issue reported on code.google.com by ceager on 6 Dec 2008 at 8:29

Attachments:

GoogleCodeExporter commented 9 years ago
While adding a check for a negative quantity—and calling remove_product if 
one is entered—should be enough, I 
think it makes sense to validate that an order_line_item's quantity is a 
positive integer.

Original comment by ceager on 6 Dec 2008 at 8:32

GoogleCodeExporter commented 9 years ago
I found one small but important error in my patch. The patch attached to this 
comment
should be reviewed.

Original comment by ceager on 8 Dec 2008 at 9:10

Attachments:

GoogleCodeExporter commented 9 years ago
Fixed r175

Thanks for the test code!

Original comment by subim...@gmail.com on 25 Jan 2009 at 8:47