Having trouble getting Grand Total with shopping cart web page

Reply

Join Date: Oct 2009
Posts: 19
Reputation: mldardy is an unknown quantity at this point 
Solved Threads: 0
mldardy mldardy is offline Offline
Newbie Poster

Having trouble getting Grand Total with shopping cart web page

 
0
  #1
Oct 27th, 2009
I am trying to get a grand total from a shopping cart page and am not sure how to do that. I have the total that loops through each section but I want to display the grand total from all of those sections at the bottom of the page. Can someone offer assistance on how to do this. Here is my code:

  1. dim totalPrice(20) //The total price on any given subform //CONFIG - change this to the maximum number of product types you ever expect to have.
  2. dim iQtys(20, 50) //CONFIG - Change this to the maximum number of items you ever expect to have on one order form.
  3. dim emailTo, emailFrom, emailSubject
  4. dim grandTotal(20)
  5.  
  6. if Request.Form("btnCalculate.x") <> 0 or Request.Form("btnCalculate.y") <> 0 then
  7. isPostback = 1 'cInt(Request.Form("btnCalculate"))
  8.  
  9.  
  10. for iCntr2 = 1 to Request.Form("NumForms")
  11.  
  12. for iCntr = 1 to Request.Form("NumElements" & iCntr2)
  13.  
  14. iQtys(iCntr2, iCntr) = CInt(Request.Form("Qty" & iCntr2 & "_" & iCntr))
  15. totalPrice(iCntr2) = totalPrice(iCntr2) + (Ccur(Request.Form("UnitPrice" & iCntr2 & "_" & iCntr)) * CInt(Request.Form("Qty" & iCntr2 & "_" & iCntr)))
  16.  
  17. next
  18.  
  19. next
  20.  
  21.  
  22. end if
  23.  
  24. totalPrice(iCntr2) = totalPrice(iCntr2) + (Ccur(Request.Form("UnitPrice" & iCntr2 & "_" & iCntr)) * CInt(Request.Form("Qty" & iCntr2 & "_" & iCntr)))
  25.  
  26. Response.write "<TR><TD align=left colspan=" & oProdInstances.Fields.Count - 2 & ">Grand Total: " & FormatCurrency(grandTotal(iForm), 2) & "</TD>"
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 19
Reputation: mldardy is an unknown quantity at this point 
Solved Threads: 0
mldardy mldardy is offline Offline
Newbie Poster
 
0
  #2
Oct 27th, 2009
Anyone with any ideas
Reply With Quote Quick reply to this message  
Reply

Message:



Similar Threads
Other Threads in the ASP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC