<% Dim sBillingInfo Dim sPayemntInfo Dim sShippingInfo Dim sShippingMethod Dim sOrderID Dim basketvarItem Dim lssql sOrderID = getOrderID() If Request.Form("SubmitOrder.x").Count > 0 then '************************************************************************** ' Final Order Submission '************************************************************************** Dim MacsOrderNo Dim MacsCustEDP Dim MacsItemtotal Dim MacsDiscount Dim MacsTax Dim MacsShipping Dim MacsGiftwraptotal Dim MacsTotal Dim OrderStatus Dim ortn MacsOrderNo="" MacsCustEDP="" MacsItemtotal="0" MacsDiscount="0" MacsTax="0" MacsShipping="0" MacsGiftwraptotal="0" MacsTotal="0" OrderStatus = 2 IF ECOMETRY_ENABLED = true then If trim(Request.Form("ConnectionCode")) = MACS_ERROR_MESSAGES(3) then set ortn = Session("ortn") if isnull(ortn) then else MacsOrderNo = Trim(ortn.GetValue("OrderNo",0)) OrderStatus = 4 MacsCustEDP = Trim(ortn.GetValue("CustEdp", 0)) MacsItemtotal = Trim(ortn.GetValue("ProductDol",0)) 'Pricing/Shipping MacsShipping = Trim(ortn.GetValue("PostageDol",0)) 'Shipping MacsTax = Trim(ortn.GetValue("TaxDol",0)) 'Tax(if applicable) MacsDiscount = Trim(ortn.GetValue("DiscountDol",0)) 'Discount Amt MacsGiftwraptotal = Trim(ortn.GetValue("GiftWrapDol",0)) 'Gift Wrap Total MacsTotal = Trim(ortn.GetValue("TotalDol",0)) end if End if else OrderStatus = 4 'confirmed when ecom is not enabled MacsOrderNo = sOrderID End if lssql = "exec p_WP_ORDERS_SUBMIT_UPDATE " & sOrderID &_ "," & OrderStatus &_ ",'" & MacsOrderNo & "'" &_ ",'" & MacsCustEDP & "'" &_ "," & MacsItemtotal & "," & MacsShipping & "," & MacsTax &_ "," & MacsDiscount & "," & MacsGiftwraptotal & "," & MacsTotal & ",1" connection.execute lssql set Session("ortn") = nothing Response.Redirect HTTPSECURE_HOST & "checkout/thankyoumain.asp?mid=" & MacsOrderNo & "&wid=" & sOrderID '************************************************************************** ' End Final Order Submission '************************************************************************** End if '************************************************************* 'Get Order Info for display '************************************************************* 'iBillIndex and iShipIndex are defined in maininclude.asp Dim customer_info() Dim customer_shipinfo() Dim MacsUserID Dim sShipToCountry Dim OrderHasGC Redim customer_info(billshiparraysize) getOrderHeaderInfo customer_info, iBillIndex getOrderAddressInfo customer_info, iBillIndex, 0, false MacsUserID = customer_info(2) sBillingInfo = getBillShipDisplayInfo(customer_info, iBillIndex) sBillingInfo = sBillingInfo & "
" & customer_info(iBillIndex) 'Email if len(customer_info(20))>0 then sPayemntInfo = customer_info(19) & " " &_ Mid(customer_info(20),1,4) & string(len(customer_info(20))-4, "*") & " " &_ customer_info(21) & "/" & customer_info(22) & " " end if OrderHasGC=false if len(customer_info(30))>0 or len(customer_info(31))>0 or len(customer_info(32))>0 or len(customer_info(33))>0 or len(customer_info(34))>0 then sPayemntInfo = sPayemntInfo & "Gift Certficate:" if len(customer_info(30))>0 then sPayemntInfo = sPayemntInfo & "
" & customer_info(30) if len(customer_info(31))>0 then sPayemntInfo = sPayemntInfo & "
" & customer_info(31) if len(customer_info(32))>0 then sPayemntInfo = sPayemntInfo & "
" & customer_info(32) if len(customer_info(33))>0 then sPayemntInfo = sPayemntInfo & "
" & customer_info(33) if len(customer_info(34))>0 then sPayemntInfo = sPayemntInfo & "
" & customer_info(34) OrderHasGC = true end if '************************************************************* 'Get Order Basket Items array '************************************************************* Dim basketItems Dim shipTotals 'basket Items will have '1=ORDER_ITEMS_ID, 2=PRODUCT_ID,3=SKU_ID,4=QTY,5=REGULAR_PRICE,6=SALE_PRICE,7=SKU, 8=ITEM_NUM '9=NAME,10=SHORT_DESC, 11=SUBTOTAL lssql = "exec p_WP_ORDER_GET_ITEMS " & sOrderID & ",-1," & Application("GIFTBOX_PRODUCT_ID") basketItems = getRecordSetList(lssql) lssql = "exec p_WP_ORDER_CALC_TOTALS " & sOrderID getRecordSetList(lssql) '1=REGULAR_SUBTOTAL, 2=SUBTOTAL, 3=SHIPPING_TOTAL, 4=TAX_TOTAL, 5=ADDITIONAL_TOTAL, 6,DISCOUNT, 7=TOTAL lssql = "exec p_WP_ORDER_GET_SHIP_TOTALS " & sOrderID & ", 1" shipTotals = getRecordSetList(lssql) if ECOMETRY_ENABLED = true then '************************************************************* ' Get the Totals from Ecometry '************************************************************* Dim EcometryOrderResponse Dim orderDebug Dim orderDebugString Dim orderResponseSize orderDebug="false" 'orderDebug="true" EcometryOrderResponse = OrderTransaction(sOrderID, orderDebug, orderDebugString) if orderDebug = "true" then Response.Write "" end if If IsArray(EcometryOrderResponse) then Else Redim EcometryOrderResponse(25) End If ERROR_MESSAGE="" Dim GCTotalAmountBalance If trim(EcometryOrderResponse(1)) = trim(MACS_ERROR_MESSAGES(1)) then 'Connection Error MacsUserID="" 'this will show the message to customer ElseIf trim(EcometryOrderResponse(1)) = trim(MACS_ERROR_MESSAGES(2)) then 'Transaction Error 'ERROR_MESSAGE="Please review the error(s):
" ERROR_MESSAGE= ERROR_MESSAGE & EcometryOrderResponse(2) ERROR_MESSAGE= ERROR_MESSAGE &_ "
Click here to edit order information.

" MacsUserID = EcometryOrderResponse(3) Else 'reassign totals from ecometry MacsUserID = EcometryOrderResponse(3) shipTotals(1)(2) = EcometryOrderResponse(5) 'subtotal shipTotals(1)(3) = EcometryOrderResponse(6) 'shipping total shipTotals(1)(4) = EcometryOrderResponse(7) 'tax total shipTotals(1)(5) = EcometryOrderResponse(8) 'giftwrap total(additional) shipTotals(1)(7) = EcometryOrderResponse(9) 'discount total shipTotals(1)(6) = EcometryOrderResponse(10) 'Order total GCTotalAmountBalance = EcometryOrderResponse(11) 'GC Balance total if OrderHasGC = true then sPayemntInfo = sPayemntInfo & "
You have " & FormatCurrency(GCTotalAmountBalance) & " remaining on gift certificates." end if End if End if 'if ECOMETRY_ENABLED = true then Dim ShipToItems Dim shiptovarItem Dim iShiptoStart Dim sBillShipSlNo Dim sShipName Dim iHowManyShipTos lssql = "exec p_WP_ORDER_GET_SHIPTO_COUNT " & sOrderID ShipToItems = getRecordSetList(lssql) iHowManyShipTos = UBound(ShipToItems) '************************************************************* %>