Monday, 27 April 2009

CW2: Problem Solving shopping Cart quantity


There was a problem with the shopping cart quantity, as it expected values which are not proper quantity like -negative numbers, decimal values, and also very large numbers. Message was posted on google groups for help in this area.





The answer posted was by me, as I had put javascript code to validate the quanity, however it gave another error later that was not showin the shopping cart page correctly after the validation occured.

So to make things simple, I have implemented a list box, loaded with values, with the list box the user will not be able to input any kind of wrong values.

in the name field this is put: "localCart(CARTPID, i )"


This sets the quantity field to default 1,


Then in the next field this is put: localCart(CARTPQUANTITY, i )


Gets the quantity from the VB Script variable. Then in the options pre-loaded values are put, from 1 - 5.


Having researched the market area, in one transactions it is very rare to have more than one 9 quantity for a product, espcially in this clothing area, for customers.


Shopping car which has the quantity list box is shown below.



No comments:

Post a Comment