I wrote this small shopping cart (1 item) and am encountering something weird. When I go to the initial "Purchase" page, the page seems to pause about half way through. I would assume this is where I have specified to write some session variables. In the application.cfm, this is what's written:
<CFAPPLICATION
NAME="WebsiteName"
SESSIONTIMEOUT=#CreateTimeSpan(0, 0, 15, 0)#
SESSIONMANAGEMENT="yes">
<CFPARAM NAME="Session.Qty" DEFAULT="">
<CFPARAM NAME="Session.Price" DEFAULT="495.00">
<CFPARAM NAME="Session.ExtPrice" DEFAULT="">
<CFPARAM NAME="Session.Weight" DEFAULT="5">
<CFPARAM NAME="Session.TotalWeight" DEFAULT="">
<CFPARAM NAME="Session.Tax" DEFAULT="">
<CFPARAM NAME="Session.TotalPrice" DEFAULT="">
On the purchase page, all that's written is <cfoutput>#DollarFormat(Session.Price)#</cfoutput>. Once I post the form, I reset the Session.Qty by <cfset Session.Qty = "#Form.Qty#">.
My question is, do I need to even set the Session.Qty to "" in the application.cfm? Also, is using CFPARAM the right way to set the variable? The reason for setting these into session variables is that I need to pass them through 3 pages to checkout.
<CFAPPLICATION
NAME="WebsiteName"
SESSIONTIMEOUT=#CreateTimeSpan(0, 0, 15, 0)#
SESSIONMANAGEMENT="yes">
<CFPARAM NAME="Session.Qty" DEFAULT="">
<CFPARAM NAME="Session.Price" DEFAULT="495.00">
<CFPARAM NAME="Session.ExtPrice" DEFAULT="">
<CFPARAM NAME="Session.Weight" DEFAULT="5">
<CFPARAM NAME="Session.TotalWeight" DEFAULT="">
<CFPARAM NAME="Session.Tax" DEFAULT="">
<CFPARAM NAME="Session.TotalPrice" DEFAULT="">
On the purchase page, all that's written is <cfoutput>#DollarFormat(Session.Price)#</cfoutput>. Once I post the form, I reset the Session.Qty by <cfset Session.Qty = "#Form.Qty#">.
My question is, do I need to even set the Session.Qty to "" in the application.cfm? Also, is using CFPARAM the right way to set the variable? The reason for setting these into session variables is that I need to pass them through 3 pages to checkout.