close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Shipping Value not showing up on Email Receipt/Success page

Thread began 11/18/2009 9:38 am by eric284736 | Last modified 11/25/2009 12:19 pm by eric284736 | 4144 views | 11 replies

eric284736

Eric,

Here is what is setup:

Checkout page - the shipping selection is pulling from the recordset and setting a session
<%
if ((Request.ServerVariables("Request_Method") = "POST") AND (inStr(Unescape(cStr(Request.ServerVariables("HTTP_REFERER"))),Unescape(Request.ServerVariables("SERVER_NAME")&Request.ServerVariables("SCRIPT_NAME"))) > 0)) then
Session("ShipSelection") = "" & cStr(cStr(Request.Form("ShipChoice"))) & ""
end if
%>


Confirm page - running a recordset to pull the session
<%
Dim rsShipping__MMColParam
rsShipping__MMColParam = "-1"
If (Session("ShipSelection") <> "") Then
rsShipping__MMColParam = Session("ShipSelection")
End If
%>
<%
Dim rsShipping
Dim rsShipping_cmd
Dim rsShipping_numRows

Set rsShipping_cmd = Server.CreateObject ("ADODB.Command")
rsShipping_cmd.ActiveConnection = MM_connJoeMedia_STRING
rsShipping_cmd.CommandText = "SELECT * FROM dbo.ShipTable WHERE ShipFee = ?"
rsShipping_cmd.Prepared = true
rsShipping_cmd.Parameters.Append rsShipping_cmd.CreateParameter("param1", 5, 1, -1, rsShipping__MMColParam) ' adDouble

Set rsShipping = rsShipping_cmd.Execute
rsShipping_numRows = 0
%>

and below the Universal mail stuff...
<%
if (Request.ServerVariables("Request_Method") = "POST") then
Session("eCartCheckoutForm_ShipChoice") = "" & cStr(Request.Form("ShipChoice")) & ""
end if
%>

AND the store summary in Orders:
<%' WA eCart Store Cart Summary in Db
if ((Request.ServerVariables("Request_Method") = "POST") AND (inStr(Unescape(cStr(Request.ServerVariables("HTTP_REFERER"))),Unescape(Request.ServerVariables("SERVER_NAME")&Request.ServerVariables("SCRIPT_NAME"))) > 0)) then
WA_connection = MM_connJoeMedia_STRING
WA_table = "dbo.Orders"
WA_redirectURL = ""
WA_indexField = "OrderReferenceID"
WA_fieldNamesStr = "OrderReferenceID|OrderShipping|OrderTax|OrderTotal|OrderDate|OrderShipAddress1|OrderShipAddress2|OrderShipCity|OrderShipStateID|OrderShipZip|CreditCardType|CreditNumber|ExpireMonth|ExpireYear|CVVcode|Processed"
WA_fieldValuesStr = "" & cStr(Session.SessionID) & "" & "|" & WA_eCDB_ConvertNumber("" & cStr((rsShipping.Fields.Item("ShipFee").Value)) & "") & "|" & WA_eCDB_ConvertNumber("" & cStr(WA_eCart_GetTax(eCart1)) & "") & "|" & WA_eCDB_ConvertNumber("" & cStr(WA_eCart_GrandTotal(eCart1)) & "") & "|" & "" & cStr(Date()) & "" & "|" & "" & cStr(cStr(Request.Form("shipping_street1"))) & "" & "|" & "" & cStr(cStr(Request.Form("shipping_street2"))) & "" & "|" & "" & cStr(cStr(Request.Form("shipping_city"))) & "" & "|" & "" & cStr(cStr(Request.Form("shipping_state_province"))) & "" & "|" & "" & cStr(cStr(Request.Form("shipping_postcode"))) & "" & "|" & "" & cStr(cStr(Request.Form("cc_type"))) & "" & "|" & "" & cStr(cStr(Request.Form("cc_number"))) & "" & "|" & WA_eCDB_ConvertNumber("" & cStr(cStr(Request.Form("exp_month"))) & "") & "|" & WA_eCDB_ConvertNumber("" & cStr(cStr(Request.Form("exp_year"))) & "") & "|" & "" & cStr(cStr(Request.Form("cvv"))) & "" & "|" & WA_eCDB_ConvertNumber("0")
WA_columnTypesStr = "',none,''|none,none,NULL|none,none,NULL|none,none,NULL|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|none,none,NULL|none,none,NULL|',none,''|none,none,NULL"
WA_sessionName = "eCart1_OrderID"
indexFieldIndex = -1
WA_fieldValues = Split(WA_fieldValuesStr,"|")
WA_fieldNames = Split(WA_fieldNamesStr,"|")
WA_columns = Split(WA_columnTypesStr,"|")
set WA_editCmd = Server.CreateObject("ADODB.Command")
updateFieldValue = ""
WA_editCmd.ActiveConnection = WA_connection
if (WA_redirectURL <> "" AND Request.QueryString <> "" AND Request.QueryString.Count > 0) then
if (inStr(WA_redirectURL,"?") > 0) then
WA_redirectURL = WA_redirectURL & "&"
else
WA_redirectURL = WA_redirectURL & "?"
end if
WA_redirectURL = WA_redirectURL & Request.QueryString
end if
for i = 0 to Ubound(WA_fieldNames)
if (WA_indexField = WA_fieldNames(i)) then
indexFieldIndex = i
exit for
end if
next
if (indexFieldIndex >= 0) then updateFieldValue = WA_fieldValues(indexFieldIndex)
if (updateFieldValue = "") then updateFieldValue = cStr(Session(WA_sessionName))
updateColType = "none,none,NULL"
if (indexFieldIndex >= 0) then
updateColType = WA_columns(indexFieldIndex)
end if
if (updateFieldValue <> "" AND updateFieldValue <> "undefined") then
valueForWhere = WA_generateInsertParams(Array(WA_indexField), Array(updateColType), Array(updateFieldValue), -1)
sqlstr = "select " & WA_indexField & " from " & WA_table & " where " & WA_indexField & " = " & valueForWhere(2) & " order by " & WA_indexField & " DESC"
set WA_eCartRecordset = Server.CreateObject("ADODB.Recordset")
WA_eCartRecordset.ActiveConnection = WA_connection
WA_eCartRecordset.Source = sqlstr
WA_eCartRecordset.CursorType = 0
WA_eCartRecordset.CursorLocation = 2
WA_eCartRecordset.LockType = 1
WA_eCartRecordset.Open()
if (NOT WA_eCartRecordset.EOF) then
updateFieldValue = cStr(WA_eCartRecordset.Fields.Item(WA_indexField).Value)
else
updateFieldValue = ""
end if
WA_eCartRecordset.Close()
end if
if (updateFieldValue <> "" AND updateFieldValue <> "undefined") then
updateParamsObj = WA_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, indexFieldIndex)
valueForWhere = WA_generateInsertParams(Array(WA_indexField), Array(updateColType), Array(updateFieldValue), -1)
WA_editCmd.CommandText = "update " & WA_table & " SET " & updateParamsObj(3) & " where " & WA_indexField & " = " & valueForWhere(2)
WA_editCmd.Execute()
WA_editCmd.ActiveConnection.Close()
else
updateFieldValue = ""
insertParamsObj = WA_generateInsertParams(WA_fieldNames, WA_columns, WA_fieldValues, -1)
WA_editCmd.CommandText = "insert into " & WA_table & " (" & insertParamsObj(1) & ") values (" & insertParamsObj(2) & ")"
WA_editCmd.Execute()
WA_editCmd.ActiveConnection.Close()
end if
if (indexFieldIndex < 0) then
if (updateFieldValue = "") then
obj = WA_generateWhereClause(WA_fieldNames, WA_columns, WA_fieldValues, indexFieldIndex)
sqlstr = "select " & WA_indexField & " from " & WA_table & " where " & obj & " order by " & WA_indexField & " DESC"
set WA_eCartRecordset = Server.CreateObject("ADODB.Recordset")
WA_eCartRecordset.ActiveConnection = WA_connection
WA_eCartRecordset.Source = sqlstr
WA_eCartRecordset.CursorType = 0
WA_eCartRecordset.CursorLocation = 2
WA_eCartRecordset.LockType = 1
WA_eCartRecordset.Open()
if (NOT WA_eCartRecordset.EOF) then Session(WA_sessionName) = WA_eCartRecordset.Fields.Item(WA_indexField).Value
WA_eCartRecordset.Close()
else
Session(WA_sessionName) = updateFieldValue
end if
else
Session(WA_sessionName) = WA_fieldValues(indexFieldIndex)
end if
if (WA_redirectURL <> "") then
Response.Redirect(WA_redirectURL)
end if
end if
%>


The checkout success page is running the shipping recordset, but shouldn't that page be pulling the shipping info already stored with the line:

<td class="eC_SummaryLabel">Shipping</td>
<td><%=WA_eCart_DisplayMoney(eCart1, WA_eCart_GetShipping(eCart1))%></td>


thx
Eric

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...