| | |
Having trouble getting Grand Total with shopping cart web page
Please support our ASP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2009
Posts: 19
Reputation:
Solved Threads: 0
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:
ASP Syntax (Toggle Plain Text)
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. dim iQtys(20, 50) //CONFIG - Change this to the maximum number of items you ever expect to have on one order form. dim emailTo, emailFrom, emailSubject dim grandTotal(20) if Request.Form("btnCalculate.x") <> 0 or Request.Form("btnCalculate.y") <> 0 then isPostback = 1 'cInt(Request.Form("btnCalculate")) for iCntr2 = 1 to Request.Form("NumForms") for iCntr = 1 to Request.Form("NumElements" & iCntr2) iQtys(iCntr2, iCntr) = CInt(Request.Form("Qty" & iCntr2 & "_" & iCntr)) totalPrice(iCntr2) = totalPrice(iCntr2) + (Ccur(Request.Form("UnitPrice" & iCntr2 & "_" & iCntr)) * CInt(Request.Form("Qty" & iCntr2 & "_" & iCntr))) next next end if totalPrice(iCntr2) = totalPrice(iCntr2) + (Ccur(Request.Form("UnitPrice" & iCntr2 & "_" & iCntr)) * CInt(Request.Form("Qty" & iCntr2 & "_" & iCntr))) Response.write "<TR><TD align=left colspan=" & oProdInstances.Fields.Count - 2 & ">Grand Total: " & FormatCurrency(grandTotal(iForm), 2) & "</TD>"
![]() |
Similar Threads
- Is this shopping cart template any good? (eCommerce)
- shopping cart (PHP)
- Shopping Cart Not Working (ASP.NET)
- Simple Shopping Cart with arrays (PHP)
- Flash Shopping Cart (Website Reviews)
- How to intertwine a form with the shopping cart (Site Layout and Usability)
- Need Help Getting Reader on to my Web Page (Site Layout and Usability)
Other Threads in the ASP Forum
- Previous Thread: SQL Injection Attacks
- Next Thread: ASP Error
| Thread Tools | Search this Thread |
archive asp asp.net aspandmssqlserver2005 aspandmssqlserver2005connection aspconnection connection database databaseconnection diagnostics dreamweaver excel fso iis microsoft msmsql mssql2005 mssqlserver2005 mssqlserver2005andasp mssqlserverandasp opentextfile record searchbox selectoption server single specfic sqlserver sqlserverconnection toolkit webserver windows7





