<%@ LANGUAGE="VBSCRIPT" %> <% PageStrings = "18, 33, 55, 56, 60, 75, 76, 80, 81, 82, 91, 92, 233, 301, 304, 305, 643, 644, 645, 646, 647, 653, 825, 836, 1012, 1185" %> <% '=============================================== ' CactuShop ASP Shopping Cart ' ©1999-2004 Cactusoft Ltd. www.cactusoft.com '=============================================== ' All rights reserved. ' Use of this code is covered by the terms and ' conditions in the license agreement. No ' unauthorized duplication or distribution is ' permitted. Cactusoft's copyright notices must ' remain in the ASP sections of the code. '=============================================== '----------------------------------------------- 'ORDER LOOKUP 'Has a short name with short querystring names 'to minimize the chance of text links wrapping 'over several lines. '----------------------------------------------- '----------------------------------------------- 'COLLECT VALUES FROM QUERYSTRING 'These details can be called up from either the 'hyperlink in the email sent to a customer when 'they make an order, or by them entering their 'customer code and order number in the boxes 'provided on the site. '----------------------------------------------- ON_ID = Request.QueryString("ON_ID") If not isnumeric(ON_ID) or ON_ID = "" then ON_ID = "0" if Request.QueryString("strFrom") = "list" Then strFrom = "y" 'strFrom will be 'list' if this page was called from customer_showorder.asp 'we need to know this so we can show the back option at the page bottom '----------------------------------------------- 'PULL OUT PRODUCTS/PRODTYPES FROM DATABASE '----------------------------------------------- If IsNumeric(ON_ID) then strQuery = "SELECT * FROM (((tblCactuShopCurrencies INNER JOIN tblCactuShopOrderNumbers ON tblCactuShopCurrencies.CUR_ID = tblCactuShopOrderNumbers.ON_CurrencyID) INNER JOIN tblCactuShopInvoiceRows ON tblCactuShopInvoiceRows.IR_OrderNumber = tblCactuShopOrderNumbers.ON_ID) INNER JOIN tblCactuShopCardholderDetails ON tblCactuShopOrderNumbers.ON_CardholderID = tblCactuShopCardholderDetails.CD_ID) INNER JOIN tblCactuShopLanguages ON tblCactuShopOrderNumbers.ON_Language = tblCactuShopLanguages.LANG_ID WHERE ON_ID = " & ON_ID & " AND CD_ID = " & DB_CD_ID Call ExecuteSQL(strQuery, numCursorType, objRecordSet) numRecordCount = objRecordSet.RecordCount If numRecordCount > 0 then ON_Details = objRecordSet("ON_Details") ON_TotalPrice = objRecordSet("ON_TotalPrice") ON_Date = objRecordSet("ON_Date") ON_Status = objRecordSet("ON_Status") ON_Details = objRecordSet("ON_Details") ON_LastModified = objRecordSet("ON_LastModified") ON_Sent = objRecordSet("ON_Sent") ON_Invoiced = objRecordSet("ON_Invoiced") ON_Shipped = objRecordSet("ON_Shipped") ON_Paid = objRecordSet("ON_Paid") ON_CouponCode = objRecordSet("ON_CouponCode") ON_CouponDiscountTotal = objRecordSet("ON_CouponDiscountTotal") ON_PricesIncTax = objRecordSet("ON_PricesIncTax") ON_TaxDue = objRecordSet("ON_TaxDue") ON_CurrencyID = objRecordSet("ON_CurrencyID") ON_TotalPriceGateway = objRecordSet("ON_TotalPriceGateway") ON_CurrencyIDGateway = objRecordSet("ON_CurrencyIDGateway") numShippingPriceExTax = objRecordSet("ON_ShippingPrice") numShippingPriceIncTax = objRecordSet("ON_ShippingPrice") + objRecordSet("ON_ShippingTax") numOrderHandlingPriceExTax = objRecordSet("ON_OrderHandlingCharge") numOrderHandlingPriceIncTax = numOrderHandlingPriceExTax + objRecordSet("ON_OrderHandlingChargeTax") numTotal = objRecordSet("ON_TotalPrice") numDiscountPercentage = objRecordSet("ON_DiscountPercentage") CUR_Symbol = objRecordSet("CUR_Symbol") If objRecordSet("CUR_HasDecimals") = "n" then CUR_HasDecimals = false else CUR_HasDecimals = true CUR_ExchangeRate = objRecordSet("CUR_ExchangeRate") CD_ID = objRecordSet("CD_ID") End if '----------------------------------------------- 'LOOKUP COUPON IF THERE IS ONE '----------------------------------------------- If ON_CouponCode <> "" then strQuery2 = "SELECT * FROM tblCactuShopCoupons WHERE CP_CouponCode='" & sqlsafe(ON_CouponCode) & "'" Call ExecuteSQL(strQuery2, numCursorType, objRecordSet2) CP_DiscountValue = objRecordSet2("CP_DiscountValue") CP_DiscountType = objRecordSet2("CP_DiscountType") If CP_DiscountType = "f" then CP_DiscountValue = ON_CouponDiscountTotal CP_CouponCode = objRecordSet2("CP_CouponCode") objRecordSet2.close End if end if '----------------------------------------------- 'READ PAGE TEMPLATE FROM FILE '----------------------------------------------- Call ReadFromTemplate(strTemplateLocation, aryPageTemplate, strBasketHTML, strCategoryListHTML) '----------------------------------------------- 'WRITE FIRST HALF OF PAGE HTML '----------------------------------------------- response.write(aryPageTemplate(0)) If numRecordCount < 1 then %>
<% WriteString("PageTitle_OrderStatus") %>
<% WriteString("ContentText_OrderNotFound") %>
<% WriteString("ContentText_LookupPage") %>
<% else %> <% '----------------------------------------------- 'DISPLAY EXTENDED INFO TO CUSTOMER ONLY IF 'ORDER TRACKING TURNED ON IN CONFIG '----------------------------------------------- If Application(LICENSENUMBER & "ordertracking") = "y" then %> <% '----------------------------------------- 'ONLY SHOW PROGRESS IF FIELD IS NOT BLANK '----------------------------------------- If len(ON_Status) <> 0 then %> <% end if %>
<% WriteString("PageTitle_OrderStatus") %>
<% WriteString("ContentText_OrderNumber") %> <% =ON_ID %>
<% WriteString("ContentText_OrderDate") %> <% =FriendlyDate(ON_Date,"d") %>
<% WriteString("ContentText_Total") %> <% =CUR_Symbol & " " & CurrencyDisplay(ON_TotalPrice, 1, CUR_HasDecimals) %>
<% WriteString("ContentText_LastUpdate") %> <% =FriendlyDate(ON_LastModified,"t") %>
<% WriteString("ContentText_OrderStatus") %>
<% If ON_Sent = "y" then %><% else %><% end if %> <% WriteString("ContentText_OrderStatusSent") %>
<% If ON_Invoiced = "y" then %><% else %><% end if %> <% WriteString("ContentText_OrderStatusInvoiced") %>
<% If ON_Paid = "y" then %><% else %><% end if %> <% WriteString("ContentText_OrderStatusPaid") %>
<% If ON_Shipped = "y" then %><% else %><% end if %> <% WriteString("ContentText_OrderStatusShipped") %>
<% WriteString("ContentText_OrderProgress") %>
<% =safeHTMLencode(ON_Status) %>
<% '----------------------------------------- 'PRICES INCLUDING TAX '----------------------------------------- If ON_PricesIncTax = "y" then If Application(LICENSENUMBER & "showtaxdisplay") = "y" then %> <% Else %> <% End if Else '----------------------------------------- 'PRICES EXCLUDING TAX '----------------------------------------- %> <% End if %> <% do while NOT objRecordSet.EOF %> <% '----------------------------------------- 'PRICES INCLUDING TAX '----------------------------------------- If ON_PricesIncTax = "y" then If Application(LICENSENUMBER & "showtaxdisplay") = "y" then %> <% Else %> <% End if %> <% Else '----------------------------------------- 'PRICES EXCLUDING TAX '----------------------------------------- %> <% End if %> <% '----------------------------------------------- 'CALCULATE TOTAL 'The total amount without tax is not stored - 'this is calculated from the invoice rows 'records as we cycle through them here. '----------------------------------------------- '----------------------------------------- 'PRICES INCLUDING TAX '----------------------------------------- If ON_PricesIncTax = "y" then numRowPriceExTax = Round((objRecordSet("IR_Quantity") * (objRecordSet("IR_PricePerItem") - objRecordSet("IR_TaxPerItem"))) - 0.0001, 2) numRowPriceIncTax = objRecordSet("IR_PricePerItem") * objRecordSet("IR_Quantity") 'Price of row inc tax (row = items x qty) numTotalPriceExTax = numTotalPriceExTax + numRowPriceExTax numTotalPriceIncTax = numTotalPriceIncTax + numRowPriceIncTax 'Running total of order price ex tax Else '----------------------------------------- 'PRICES EXCLUDING TAX '----------------------------------------- numRowPriceExTax = Round(objRecordSet("IR_PricePerItem") * objRecordSet("IR_Quantity") , 2) numRowPriceIncTax = objRecordSet("IR_PricePerItem") * objRecordSet("IR_Quantity") * (1 + objRecordSet("IR_TaxPerItem")) 'Price of row ex tax (row = items x qty) numTotalPriceExTax = numTotalPriceExTax + numRowPriceExTax numTotalPriceIncTax = numTotalPriceIncTax + numRowPriceIncTax 'Running total of order price ex tax End if objRecordSet.movenext loop '----------------------------------------- 'FINAL TOTAL DEPENDS ON COUNTRY '----------------------------------------- If ON_TaxDue = 1 then strOrderValueTotal = GetString("ContentText_TotalOrderValue") & " = " & CUR_Symbol & " " & CurrencyDisplay(numTotalPriceIncTax, 1, CUR_HasDecimals) & "
" strShipping = GetString("ContentText_Shipping") & " = " & CUR_Symbol & " " & CurrencyDisplay(numShippingPriceIncTax, 1, CUR_HasDecimals) If numOrderHandlingPriceIncTax > 0 then strOrderHandlingCharge = "
" & GetString("ContentText_OrderHandlingCharge") & " = " & CUR_Symbol & " " & CurrencyDisplay(numOrderHandlingPriceIncTax, 1, CUR_HasDecimals) Else strOrderValueTotal = GetString("ContentText_TotalOrderValue") & " = " & CUR_Symbol & " " & CurrencyDisplay(numTotalPriceExTax, 1, CUR_HasDecimals) & "
" strShipping = GetString("ContentText_Shipping") & " = " & CUR_Symbol & " " & CurrencyDisplay(numShippingPriceExTax, 1, CUR_HasDecimals) If numOrderHandlingPriceExTax > 0 then strOrderHandlingCharge = "
" & GetString("ContentText_OrderHandlingCharge") & " = " & CUR_Symbol & " " & CurrencyDisplay(numOrderHandlingPriceExTax, 1, CUR_HasDecimals) End if '----------------------------------------- 'LOOKUP GATEWAY CURRENCY USED 'Only needed if different from the one the 'customer used. '----------------------------------------- If ON_CurrencyIDGateway <> ON_CurrencyID then '----------------------------------------- 'LOOKUP DETAILS OF CURRENCY GATEWAY USES '----------------------------------------- strQuery = "SELECT * FROM tblCactuShopCurrencies WHERE CUR_ID = " & ON_CurrencyIDGateway Call ExecuteSQL(strQuery, numCursorType, objRecordSet2) aryCurrenciesGateway(0) = objRecordSet2("CUR_ID") aryCurrenciesGateway(1) = objRecordSet2("CUR_Symbol") aryCurrenciesGateway(2) = objRecordSet2("CUR_ISOCode") aryCurrenciesGateway(3) = objRecordSet2("CUR_ExchangeRate") If objRecordSet2("CUR_HasDecimals") = "y" then aryCurrenciesGateway(4) = true else aryCurrenciesGateway(4) = false aryCurrenciesGateway(5) = objRecordSet2("CUR_Name" & CStr(numLanguageID)) objRecordSet2.close Else '----------------------------------------- 'ORDERS PROCESSED IN USER SELECTED CURR. '----------------------------------------- aryCurrenciesGateway(0) = aryCurrencies(0) aryCurrenciesGateway(1) = aryCurrencies(1) aryCurrenciesGateway(2) = aryCurrencies(2) aryCurrenciesGateway(3) = aryCurrencies(3) aryCurrenciesGateway(4) = aryCurrencies(4) aryCurrenciesGateway(5) = aryCurrencies(5) End if numFinalTotalPriceInTaxGateway = Round(ON_TotalPriceGateway, 2) strOrderValueTotalGateway = "" & GetString("EmailText_ProcessCurrencyExp1") & " " & aryCurrenciesGateway(1) & " " & CurrencyDisplay(numFinalTotalPriceInTaxGateway, 1, aryCurrenciesGateway(4)) & "" %>
<% WriteString("ContentText_ExTax") %>  <% WriteString("ContentText_IncTax") %> <% WriteString("ContentText_Price") %> <% WriteString("ContentText_Price") %>  <% WriteString("ContentText_Tax") %> (%) <% WriteString("ContentText_Qty") %> <% WriteString("ContentText_Total") %>
<% =objRecordSet("IR_VersionName") %>
<% =objRecordSet("IR_VersionCode") %><% =CUR_Symbol & " " & CurrencyDisplay(objRecordSet("IR_PricePerItem") - objRecordSet("IR_TaxPerItem"), 1, CUR_HasDecimals) %> <% =CUR_Symbol & " " & CurrencyDisplay(objRecordSet("IR_TaxPerItem"), 1, CUR_HasDecimals) %><% =CUR_Symbol & " " & CurrencyDisplay(objRecordSet("IR_PricePerItem"), 1, CUR_HasDecimals) %><% =objRecordSet("IR_Quantity") %> <% =CUR_Symbol & " " & CurrencyDisplay(objRecordSet("IR_PricePerItem") * objRecordSet("IR_Quantity"), 1, CUR_HasDecimals) %><% =CUR_Symbol & " " & CurrencyDisplay(objRecordSet("IR_PricePerItem"), 1, CUR_HasDecimals) %> <% =objRecordSet("IR_TaxPerItem") * 100 %> <% =objRecordSet("IR_Quantity") %> <% =CUR_Symbol & " " & CurrencyDisplay((0.0001 + (objRecordSet("IR_PricePerItem") * objRecordSet("IR_Quantity") * (1 + objRecordSet("IR_TaxPerItem")))), 1, CUR_HasDecimals) %>
<% '----------------------------------------------- 'WRITE TOTALS '----------------------------------------------- If ON_CouponCode <> "" then If CP_DiscountType = "p" then strCouponDiscount = GetString("ContentText_CouponDiscount") & " = " & CP_DiscountValue & "%
" Else strCouponDiscount = GetString("ContentText_CouponDiscount") & " = " & CUR_Symbol & " " & CurrencyDisplay(CP_DiscountValue, 1, CUR_HasDecimals) & "
" End if End if If numDiscountPercentage <> 0 then strDiscountPercentage = GetString("ContentText_Discount") & " = " & numDiscountPercentage & "%
" End if strTotal = "
" & GetString("ContentText_Total") & " = " & CUR_Symbol & " " & CurrencyDisplay(numTotal, 1, CUR_HasDecimals) & "
" response.write(strOrderValueTotal & strCouponDiscount & strDiscountPercentage & strShipping & strOrderHandlingCharge & "
" & strTotal & vbcrlf) If ON_CurrencyIDGateway <> ON_CurrencyID then response.write("
" & strOrderValueTotalGateway & "
") %>
<% end if If strFrom = "y" then %>
<< <% WriteString("ContentText_GoBack") %>
<% end if end if objRecordSet.close '----------------------------------------------- 'WRITE LAST HALF OF PAGE HTML '----------------------------------------------- response.write(aryPageTemplate(1)) '----------------------------------------------- 'CLOSE DATA CONNECTIONS '----------------------------------------------- objDataConn.Close set objDataConn = nothing %>