No, CARTPDELIVERY is the postage cost for each product in the session variable, the IF loop goes through each product added and outputs the details into the table.
The totalling lines are at the start of the code block I put up:
<%
FOR i = 0 TO UBOUND( localCart, 2 )
IF localCart( CARTPID, i ) <> "" THEN
subTotal = subTotal + ( localCart( CARTPPRICE, i ) * localCart( CARTPQUANTITY, i ) )
postage = ( localCart( CARTPDELIVERY, i ))
vat = ( ( (subTotal + postage ) * 17.5 )/100 )
orderTotal = subTotal + postage + vat
%>
the "postage =" is the one I need to return the highest postage value.
At present it only outputs the postage value for the last product added.
Hope this helps.
Main Topics
Browse All Topics





by: topazgPosted on 2007-10-05 at 04:36:00ID: 20020953
I'm going to guess here that CARTPDELIVERY is already a decimal number holding the "added together" postage costs - presumably stored as a single piece of data in a basket table? If so, how are these added into the database in the first place?
From what I can read, that code appears designed to output the contents of the basket, including delivery costs for each time, and display to the page.
I can't see any "summary" or "totalling" lines here?