Chrisschristou, ask yourself a few questions :
- Why calculate
grandtotalbut not use it?
- Why is
grandtotal = parseFloat(totalofptotal + shippingtotal)inside the loop?
- Should there be a
shippingtotal += ...statement?
- Is the expression
shippingtotal = parseFloat(shipping * wholeqtty)correct? Is shipping proportional to quantity? It may be, but typically it doesn't cost twice as much to ship two items to the same address. Most shipping companies charge by weight or "volumetric weight".
grandtotal = parsefloat(...)and
shippingtotal = parsefloat(...)- Why
parsefloat()values that are already numbers?
parsefloat()is only necessary to convert a string representation of a number to Number.
Edited by Airshow