I have an issue I've been struggling with:
Our website is set up so that a customer starts a session by entering their zip code and account number. The variables are collected as they order. At the end of the order, the site is supposed to email them a copy of the invoice for their order... again using the session variables, and this time using an include. On testing I get back this:
A CFOUTPUT tag is nested in a CFMAIL tag with no GROUP= or QUERY= attributes. This is not allowed. Nesting these tags implies that you want to used grouped processing. However, the outer tag does not specify a query to look over a group to process.
Here is the code:
<cfoutput>
<cfmail to="orderdesk@millerdavis.com, annam@millerdavis.com" from="orderdesk@millerdavis.com" cc="#Session.email#" subject="Client Web Order" type="html">
<cfoutput>
<table border="1" width="400" cellspacing="0" cellpadding="3">
<tr>
<td colspan="3">
#Session.OrderName#<br>
#Session.ClientName# <br>
#Session.ClientAddress1# <br>
#Session.ClientAddress2# <br>
#Session.ClientCity#, #Session.ClientState# #Session.ClientZip# <br>
#Session.ClientPhone#<P>
</td>
<td>Account Number: #Session.ClientMDCID#</td>
<td valign="top">#DateFormat(now())#</td>
</tr>
<tr>
<td><b>Form Number</b></td>
<td><b>Item</b></td>
<td><b>Quantity</b></td>
<td><b>Price</b></td>
<td><b>Total</b></td>
</tr>
<!--- Intialize GrandTotal at 0--->
<cfset GrandTotal = 0>
<!--- Start loop ------------------------------------------------------------ --->
<!--- Loop through each item in Session.StoreItems list and add it and quantity to lineItem table--->
<!--- Get legnth of list --->
<cfloop from="1" to="#ListLen(Session.StoreItems)#" index="i">
<!--- set productID i to ProID --->
<cfset ProID =#ListGetAt(Session.StoreItems, i)#>
<!--- set quantity i to theQuant --->
<cfset theQuant = #ListGetAt(Session.StoreQuantities, i)#>
<!--- query the product table to get price of item i --->
<CFQUERY NAME="getPrice" DATASOURCE="MillerDavis">
SELECT PriceType, Price as pPrice, Description, FormNo
FROM MDForms
Where FormID = #ProID#
</CFQUERY>
<!--- set price to thePrice and get linetotal> May need to update this for account holders --->
<cfswitch expression=#getPrice.PriceType#>
<cfcase value="1">
<cfif theQuant gt 11>
<cfset thePrice = 1.11>
<cfelse>
<cfset thePrice = 1.55>
</cfif>
</cfcase>
<cfcase value="2">
<cfif theQuant gt 11>
<cfset thePrice = 1.89>
<cfelse>
<cfset thePrice = 2.49>
</cfif>
</cfcase>
<cfdefaultcase>
<cfset thePrice = #getprice.pPrice#>
</cfdefaultcase>
</cfswitch>
<!--- Set linetotal to price of product times value i of Session.StoreQuantites --->
<cfset lineTotal = thePrice * theQuant>
<!--- Set grandTotal to grandTotal plus lineTotal of item i of Session.StoreItems --->
<cfset GrandTotal= GrandTotal + lineTotal>
<tr>
<td>#getprice.FormNo# </td>
<td>#getprice.description# </td>
<td>#theQuant# </td>
<td>#DollarFormat(thePrice)#</td>
<td>#DollarFormat(lineTotal)#</td>
</tr>
</cfloop>
<tr>
<td colspan="4"><b>Subtotal</b> </td>
<td>#DollarFormat(GrandTotal)#</td>
</tr>
<cfif Session.ClientState eq "MN">
<cfset taxrate = 0.07>
<cfelse>
<cfset taxrate = 0>
</cfif>
<cfset shipping = 5>
<cfset Grandtotal = Grandtotal + shipping>
<cfset tax = GrandTotal * taxrate>
<cfset grandTotal = grandTotal + tax>
<tr>
<td colspan="4"><b>Shipping</b> </td>
<td>#DollarFormat(shipping)# *</td>
</tr>
<tr>
<td colspan="4"><b>Tax</b> </td>
<td>#DollarFormat(tax)#</td>
</tr>
<tr>
<td colspan="4"><b>Grand Total</b></td>
<td>#DollarFormat(grandTotal)#</td>
</tr>
<TR>
<TD colspan="5"><font size="-2">* When a large number of forms are ordered (over 100), shipping may be more than $5.00. If this is the case, the receipt that ships with the order will reflect the new shipping amount.</font></td>
</tr>
</table>
</cfmail>
</cfoutput>
Help anyone?
Our website is set up so that a customer starts a session by entering their zip code and account number. The variables are collected as they order. At the end of the order, the site is supposed to email them a copy of the invoice for their order... again using the session variables, and this time using an include. On testing I get back this:
A CFOUTPUT tag is nested in a CFMAIL tag with no GROUP= or QUERY= attributes. This is not allowed. Nesting these tags implies that you want to used grouped processing. However, the outer tag does not specify a query to look over a group to process.
Here is the code:
<cfoutput>
<cfmail to="orderdesk@millerdavis.com, annam@millerdavis.com" from="orderdesk@millerdavis.com" cc="#Session.email#" subject="Client Web Order" type="html">
<cfoutput>
<table border="1" width="400" cellspacing="0" cellpadding="3">
<tr>
<td colspan="3">
#Session.OrderName#<br>
#Session.ClientName# <br>
#Session.ClientAddress1# <br>
#Session.ClientAddress2# <br>
#Session.ClientCity#, #Session.ClientState# #Session.ClientZip# <br>
#Session.ClientPhone#<P>
</td>
<td>Account Number: #Session.ClientMDCID#</td>
<td valign="top">#DateFormat(now())#</td>
</tr>
<tr>
<td><b>Form Number</b></td>
<td><b>Item</b></td>
<td><b>Quantity</b></td>
<td><b>Price</b></td>
<td><b>Total</b></td>
</tr>
<!--- Intialize GrandTotal at 0--->
<cfset GrandTotal = 0>
<!--- Start loop ------------------------------------------------------------ --->
<!--- Loop through each item in Session.StoreItems list and add it and quantity to lineItem table--->
<!--- Get legnth of list --->
<cfloop from="1" to="#ListLen(Session.StoreItems)#" index="i">
<!--- set productID i to ProID --->
<cfset ProID =#ListGetAt(Session.StoreItems, i)#>
<!--- set quantity i to theQuant --->
<cfset theQuant = #ListGetAt(Session.StoreQuantities, i)#>
<!--- query the product table to get price of item i --->
<CFQUERY NAME="getPrice" DATASOURCE="MillerDavis">
SELECT PriceType, Price as pPrice, Description, FormNo
FROM MDForms
Where FormID = #ProID#
</CFQUERY>
<!--- set price to thePrice and get linetotal> May need to update this for account holders --->
<cfswitch expression=#getPrice.PriceType#>
<cfcase value="1">
<cfif theQuant gt 11>
<cfset thePrice = 1.11>
<cfelse>
<cfset thePrice = 1.55>
</cfif>
</cfcase>
<cfcase value="2">
<cfif theQuant gt 11>
<cfset thePrice = 1.89>
<cfelse>
<cfset thePrice = 2.49>
</cfif>
</cfcase>
<cfdefaultcase>
<cfset thePrice = #getprice.pPrice#>
</cfdefaultcase>
</cfswitch>
<!--- Set linetotal to price of product times value i of Session.StoreQuantites --->
<cfset lineTotal = thePrice * theQuant>
<!--- Set grandTotal to grandTotal plus lineTotal of item i of Session.StoreItems --->
<cfset GrandTotal= GrandTotal + lineTotal>
<tr>
<td>#getprice.FormNo# </td>
<td>#getprice.description# </td>
<td>#theQuant# </td>
<td>#DollarFormat(thePrice)#</td>
<td>#DollarFormat(lineTotal)#</td>
</tr>
</cfloop>
<tr>
<td colspan="4"><b>Subtotal</b> </td>
<td>#DollarFormat(GrandTotal)#</td>
</tr>
<cfif Session.ClientState eq "MN">
<cfset taxrate = 0.07>
<cfelse>
<cfset taxrate = 0>
</cfif>
<cfset shipping = 5>
<cfset Grandtotal = Grandtotal + shipping>
<cfset tax = GrandTotal * taxrate>
<cfset grandTotal = grandTotal + tax>
<tr>
<td colspan="4"><b>Shipping</b> </td>
<td>#DollarFormat(shipping)# *</td>
</tr>
<tr>
<td colspan="4"><b>Tax</b> </td>
<td>#DollarFormat(tax)#</td>
</tr>
<tr>
<td colspan="4"><b>Grand Total</b></td>
<td>#DollarFormat(grandTotal)#</td>
</tr>
<TR>
<TD colspan="5"><font size="-2">* When a large number of forms are ordered (over 100), shipping may be more than $5.00. If this is the case, the receipt that ships with the order will reflect the new shipping amount.</font></td>
</tr>
</table>
</cfmail>
</cfoutput>
Help anyone?