Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calculation of shipping fee

Status
Not open for further replies.

KayUK

Programmer
Aug 22, 2007
3
GB
Hi!
I have created an eCommerce site. And I would like to add delivery fee depending on the weight of the product we sell.
I managed to calculate the total weight but do not know how to calculate shipping fee. Below is the calculation code. I added IF statement such as IF wTotal < 1000 THEN deliveryPrice = 20.00
However, this does not work.
Can anyone help me??

<%
FOR i = 0 TO UBOUND( localCart, 2 )
IF localCart( CARTPID, i ) <> "" THEN
orderTotal = orderTotal + ( localCart( CARTPPRICE, i ) * localCart( CARTPQUANTITY, i ) )
taxTotal = (orderTotal + 10.00) * 0.175
payTotal = (orderTotal + 10.00) + taxTotal
wTotal = wTotal + ( localCart( CARTPWEIGHT, i ) * localCart( CARTPQUANTITY, i ))
%>
 
To get the best from these forums read faq222-2244 first. One of the standard 'help' sources is w3schools. Your current problem is easy to resolve using a Select Case statement - see
___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top