I have a shopping basket, which i need to to add some code to for variable postage.:
Ive ommited all the html i would write on the fly here:
A loop includes this:
**************
qtyprice = Price * qtyselected
dblTotalPrice = cDbl(dblTotalPrice) + cDbl(qtyprice)
**************
I take the price field out of the db, and set its total equal to how many are selected.
for example for one item, its variable costs, depending on quantity could read in like this:
------------
qtyprice = Price * qtyselected
or
20 = 10 * 2
-------------
then
-------------
dblTotalPrice = cDbl(dblTotalPrice) + cDbl(qtyprice)
or
0 = 0 + 20
-------------
Then for each iteration of the loop the total cost will build up.
So we can see the first takes a total cost an item x how many are wanted.
Then we can see the second bit holds a total value for this previous value and keeps adding for each loop.
----
So, whats wrong here.
Well i need to add postage costs, at 2.00 for the first item selected, and 1.00 for every other item after the first.
How can this be achieved building on existing code, or adding new?
Thanks
Dave
Ive ommited all the html i would write on the fly here:
A loop includes this:
**************
qtyprice = Price * qtyselected
dblTotalPrice = cDbl(dblTotalPrice) + cDbl(qtyprice)
**************
I take the price field out of the db, and set its total equal to how many are selected.
for example for one item, its variable costs, depending on quantity could read in like this:
------------
qtyprice = Price * qtyselected
or
20 = 10 * 2
-------------
then
-------------
dblTotalPrice = cDbl(dblTotalPrice) + cDbl(qtyprice)
or
0 = 0 + 20
-------------
Then for each iteration of the loop the total cost will build up.
So we can see the first takes a total cost an item x how many are wanted.
Then we can see the second bit holds a total value for this previous value and keeps adding for each loop.
----
So, whats wrong here.
Well i need to add postage costs, at 2.00 for the first item selected, and 1.00 for every other item after the first.
How can this be achieved building on existing code, or adding new?
Thanks
Dave