You can do it something like this. The code below will output the price for each item in the cart and show the total price in a row at the bottom.
<!--- this table is just here for formatting purposes you don't need it --->
<TABLE BORDER="1">
<TR>
<TH>
Prices
</TH>
</TR>
<!--- Create a variable to hold the total price so far --->
<CFSET TotalPrice = 0>
<!--- output the query --->
<CFOUTPUT Query="myQuery">
<!--- increment the total price --->
<CFSET TotalPrice = TotalPrice + myQuery.price>
<!--- Again these table rows and cells are just for display purposes you can display the prices any way you like --->
<TR>
<TD>
#myQuery.price#
</TD>
</TR>
<!--- end looping of the query --->
</CFLOOP>
<!--- output the total price --->
<TR>
<TD>
#TotalPrice#
</TD>
</TR>
<!--- close the table --->
</TABLE>
Hope that helps
Spike
Main Topics
Browse All Topics





by: CF_SpikePosted on 2001-06-06 at 06:54:46ID: 6159527
You can do it something like this. The code below will output the price for each item in the cart and show the total price in a row at the bottom.
<!--- this table is just here for formatting purposes you don't need it --->
<TABLE BORDER="1">
<TR>
<TH>
Prices
</TH>
</TR>
<!--- Create a variable to hold the total price so far --->
<CFSET TotalPrice = 0>
<!--- output the query --->
<CFOUTPUT Query="myQuery">
<!--- increment the total price --->
<CFSET TotalPrice = TotalPrice + myQuery.price>
<!--- Again these table rows and cells are just for display purposes you can display the prices any way you like --->
<TR>
<TD>
#myQuery.price#
</TD>
</TR>
<!--- end looping of the query --->
</CFLOOP>
<!--- output the total price --->
<TR>
<TD>
#TotalPricef#
</TD>
</TR>
<!--- close the table --->
</TABLE>
Hope that helps
Spike