<%@ Language=VBScript %> <% option explicit Response.Buffer=True Const vDebug = 0 %> <% '@BEGINVERSIONINFO '@APPVERSION: 50.4014.0.6 '@FILENAME: order.asp '@DESCRIPTION: Cart Page '@STARTCOPYRIGHT 'The contents of this file is protected under the United States 'copyright laws and is confidential and proprietary to 'LaGarde, Incorporated. Its use or disclosure in whole or in part without the 'expressed written permission of LaGarde, Incorporated is expressly prohibited. ' '(c) Copyright 2000, 2001 by LaGarde, Incorporated. All rights reserved. '@ENDCOPYRIGHT '@ENDVERSIONINFO 'Modified 12/4/01 'Storefront Ref#'s: 241 djp If Session("SessionID") = "" Then 'SFUPDATE ' redirect to neworder screen Session.Abandon 'Response.Redirect(C_HomePath & "search.asp") Response.Redirect("search.asp") End If Order_InitializeDiscounts If iConverion = 1 Then Response.Write "" Dim CurrencyISO,rstAdmin,bActiveCart set rstadmin = server.CreateObject ("ADODB.Recordset") rstAdmin.Open "Select adminSaveCartActive from sfAdmin",cnn,adOpenStatic ,adLockReadOnly ,adCMDText bActiveCart = rstAdmin("adminSaveCartActive") rstAdmin.Close set rstAdmin = nothing 'Response.Write bactiveCart 'Response.End CurrencyISO = getCurrencyISO(Session.LCID ) %> <% Order_ShowInventoryMessage 'SFAE %> <%= C_STORENAME %>-Secure Shopping Cart. Begin Checkout
 
Order Brochure
Frequently Asked Questions
About Us
Home Page

Free Shipping!!
(Minimum Quantities Apply)
Click here for details

"What  a great product for a do-it-yourself homeowner.  We put our deck in on a Saturday and had company  over that night for BBQ!"

 


View Cart

Order Summary
Please review your order as shown below. To modify the quantity of any item ordered, input the desired quantity and select the Recalculate Order button below. To delete an item click on DELETE.<%if bactiveCart = 1 then %> To save an item to return and purchase at a later time click on Wish List. If you want to add new items return to the correct page and select additional items to be added to your order. When you have completed your order, select the Check Out button below to connect to our secure directory and complete the order process. <% end if %>
<% '@BEGINCODE Dim sSql, rsAllOrders, sProdID, aProduct, aProdAttr, sProdName, sProdPrice, iProdAttrNum, iCounter Dim sAttrUnitPrice, sUnitPrice, iQuantity, iNewQuantity, sProductSubtotal, dProductSubtotal, sTotalPrice, iOrderID, aProdAttrID, sProductPrice Dim iProductCounter, sBgColor, sFontFace, sFontColor, iFontSize Dim bHasProducts, sBtnAction, sSaveCart, sDelete, iSvdCartID,iCustID, sRecalculate, iSaveFind, iDeleteFind Dim sErrorDescription, sSearchPath, sBkGrnd, sReferer Dim dUnitPrice ' Determine action and OrderID For iCounter = 1 to Request.Form("iProductCounter") sSaveCart = Request.Form("SaveToCart" & iCounter & ".x") If sSaveCart <> "" Then iSaveFind = iCounter sBtnAction = "SaveToCart" Exit For End If sDelete = Request.Form("DeleteFromOrder" & iCounter & ".x") If sDelete <> "" Then iDeleteFind = iCounter sBtnAction = "DeleteFromCart" Exit For End If Next ' Check to see if custID exists in customer table iCustID = Request.Cookies("sfCustomer")("custID") If iCustID <> "" Then Dim bCustIdExists bCustIdExists = CheckCustomerExists(iCustID) If bCustIdExists = false Then Response.Cookies("sfCustomer")("custID") = "" Response.Cookies("sfCustomer").Expires = NOW() End If End If ' Determine if it is recalculate action sRecalculate = Request.Form("recalc") If sRecalculate = "1" AND lcase(sBtnAction) <> "savetocart" Then '#530 sBtnAction = "Recalculate" End If ' Get referer sReferer = Session("HttpReferer") ' Recalculate subtotal If sBtnAction = "Recalculate" Then Dim iTmpOrderID, iOldQuantity For iCounter = 1 To Request.Form("iProductCounter") iNewQuantity = Request.Form("FormQuantity" & iCounter) iOldQuantity = Request.Form("iQuantity" & iCounter) iTmpOrderID = Request.Form("iOrderID" & iCounter) if not isnumeric(iNewQuantity) or trim(iNewQuantity) ="" then iNewQuantity = iOldQuantity end if Order_Update_GiftWrapsBackOrder 'SFAE b2 If iNewQuantity <> "" Then If iNewQuantity = 0 Then ' Delete if 0 Call setDeleteOrder("odrdttmp",iTmpOrderID) DeleteTmpOrderDetailsAE iTmpOrderID 'SFAE ElseIf iNewQuantity <> iOldQuantity Then ' Update Quantity For Product Call setReplaceQuantity("odrdttmp",iNewQuantity,iTmpOrderID) End If Else ' Delete if Null Value Call setDeleteOrder("odrdttmp",iTmpOrderID) DeleteTmpOrderDetailsAE iTmpOrderID 'SFAE End If Next Reset_Shipping '# 425 Order_AdjustCart 'SFAE b2 ' Save to Cart ElseIf sBtnAction = "SaveToCart" Then sProdID = Request.Form("sProdID" & iSaveFind) iOrderID = Request.Form("iOrderID" & iSaveFind) iQuantity = Request.Form("iQuantity" & iSaveFind) iProdAttrNum = Request.Form("iProdAttrNum" & iSaveFind) iCustID = Request.Cookies("sfCustomer")("custID") iNewQuantity = Request.Form("FormQuantity" & iSaveFind) ' In the case that one types in a new quantity and hits save If iNewQuantity <> iQuantity And iNewQuantity <> "" And iNewQuantity <> 0 Then iQuantity = iNewQuantity End If If iProdAttrNum > 0 Then Redim aProdAttr(iProdAttrNum) aProdAttr = getProdAttr("odrattrtmp",iOrderID,iProdAttrNum) End If ' Check if cookies are set If Request.Cookies("sfCustomer")("custID") = "" OR Request.Cookies("sfOrder")("SessionID") <> Session("SessionID") Then ' Write to cookie identifying place Call getSavedTable(aProdAttr,sProdID,iNewQuantity,0,sReferer) Response.Cookies("sfThanks")("PreviousAction") = "FromShopCart" Response.Cookies("sfThanks")("DeleteTmpOrderID") = iOrderID Response.Cookies("sfThanks").Expires = Date() + 1 Response.Redirect("login.asp") End If If iProdAttrNum > 0 Then Redim aProdAttr(iProdAttrNum) aProdAttr = getProdAttr("odrattrtmp",iOrderID,iProdAttrNum) End If iSvdCartID = getOrderID("odrdtsvd","odrattrsvd", sProdID,aProdAttr,cInt(iProdAttrNum)) If iSvdCartID <> "" Then ' New Row in SavedCartDetails If iSvdCartID < 0 Then ' Write as new row Call getSavedTable(aProdAttr,sProdID,iQuantity,iCustID,Session("HttpReferer")) ' Existing cart Else ' Update Quantity Call setUpdateQuantity("odrdtsvd",iQuantity,iSvdCartID) ' End iSvdCartID exists If End If Else 'sErrorDescription = "Number of attributes not equal to the product specs or database writing error." 'Response.Redirect("error.asp?strPageName=order.asp&strErrorDescription="&sErrorDescription) ' End iSvdCartID Null If End If ' delete from sfTmpOrderDetails Call setDeleteOrder("odrdttmp",iOrderID) ElseIf sBtnAction = "DeleteFromCart" Then ' Remove from cart iOrderID = Request.Form("iOrderID" & iDeleteFind) Call setDeleteOrder("odrdttmp",iOrderID) DeleteTmpOrderDetailsAE iOrderID 'SFAE Call Reset_Shipping End If ' Product counter initialize iProductCounter = 0 sTotalPrice = 0 '----------------------------------------------------------------- ' Collect all orders associated with Session ::: Begin '----------------------------------------------------------------- ' Get a RecordSet of all orders sSql = "SELECT * FROM sfTmpOrderDetails WHERE odrdttmpSessionID = " & Session("SessionID") If vDebug = 1 Then Response.Write "
" & sSql Set rsAllOrders = cnn.execute(sSql) ' Check for no orders If (rsAllOrders.BOF And rsAllOrders.EOF) Then bHasProducts = False %> <% Else bHasProducts = True Do While NOT rsAllOrders.EOF ' Get the ProdIDs iOrderID = rsAllOrders.Fields("odrdttmpID") sProdID = rsAllOrders.Fields("odrdttmpProductID") iQuantity = rsAllOrders.Fields("odrdttmpQuantity") ' Get an array of 3 values from getProduct() '++ On Error Resume Next ReDim aProduct(3) aProduct = getProduct(sProdID) sProdName = aProduct(0) sProdPrice = aProduct(1) iProdAttrNum = aProduct(2) ' ++ Call CheckForError() 'Order_SetProdPrice 'SFAE ' If not an array, then the product does not exist If NOT IsArray(aProduct) Then Response.Write "
Product Does Not Exist" ' ++ Needs to MoveNext to iterate through the rest of the order Else If NOT IsNumeric(iProdAttrNum)Then iProdAttrNum = 0 End If ' Get Associated Attribute IDs in an array If iProdAttrNum <> "" Then ReDim aProdAttrID(iProdAttrNum) aProdAttrID = getProdAttr("odrattrtmp",iOrderID,iProdAttrNum) End If ' Response Write all Output If vDebug = 1 And IsArray(aProdAttrID) Then Response.Write "

Product = " & sProdID & "
ProdName = " & sProdName & "
ProdPrice = " & sProdPrice & "
ProdAttrNum = " & iProdAttrNum For iCounter = 0 To iProdAttrNum -1 Response.Write "
Attribute :" & aProdAttrID(iCounter) Next End If iProductCounter = iProductCounter + 1 dim fontclass ' Do alternating colors and fonts If (iProductCounter mod 2) = 1 Then fontclass="tdAltFont1" Else fontclass="tdAltFont2" End If %>

<%OVC_ShowGiftWrapValue 1 'SFAE%> <%OVC_ShowBackOrderMessage 1'SFAE %> <% ' End IsArray If End If sTotalPrice = cdbl(sTotalPrice) + cDbl(dProductSubtotal) 'SFUPDATE ' Move to next RecordSet rsAllOrders.MoveNext ' loop through recordset Loop '@ENDCODE '----------------------------------------------------------- ' END PRODUCT DETAIL OUTPUT -------------------------------- '----------------------------------------------------------- 'Order_FixTable 'SFAE b2 %>
product unit price qty price action

No Items in Order
Please press continue to begin searching for items.

<%= sProdName %>
<% sAttrUnitPrice = 0 ' Iterate Through Attributes If iProdAttrNum > 0 And IsArray(aProdAttrID) Then Dim sAttrSubtotal, aAttrDetails, sAttrName, sAttrPrice, iAttrType For iCounter = 0 To iProdAttrNum - 1 aAttrDetails = getAttrDetails(aProdAttrID(iCounter)) sAttrName = aAttrDetails(0) sAttrPrice = aAttrDetails(1) iAttrType = aAttrDetails(2) ' Calculate Subtotal sAttrUnitPrice = getAttrUnitPrice(sAttrUnitPrice,sAttrPrice,iAttrType) %>   <%=sAttrName%>
<% ' ProdAttr Loop Next Elseif iProdAttrNum > 0 And NOT IsArray(aProdAttrID) Then Response.Write "
Error: No Attributes found for " & iOrderID Response.Write "
Deleting from Saved Orders. Sorry for the inconvenience." Call setDeleteOrder("odrdttmp",iOrderID) DeleteTmpOrderDetailsAE iOrderID 'SFAE If vDebug = 1 Then Response.Write "

Deleted: " & iOrderID & "" ' End Product Attribute If End If dUnitPrice = cdbl(cDbl(sAttrUnitPrice) + cDbl(sProdPrice)) Order_SetProdPrice 'SFAE ' Set Unit Price for Product If iConverion = 1 Then sUnitPrice = "" Else sUnitPrice = FormatCurrency(dUnitPrice) End If dProductSubtotal = iQuantity * (dUnitPrice) If iConverion = 1 Then sProductSubtotal = "" Else sProductSubtotal = FormatCurrency(dProductSubtotal) End If 'sTotalPrice = sTotalPrice + cDbl(dProductSubtotal) 'SFUPDATE %>

<%= sUnitPrice %> <%= sProductSubtotal %>
<% if bActiveCart = 1 then %>
<% end if %>
<%= getShippingSaleText(0) %>

<%= getGlobalSaleText %>

Recalculate Order

<%Order_ShowCouponLink'SFAE%> <%OVC_SaveSubTotalWOD 'SFAE%> <%If Application("AppName") = "StoreFront" Then 'SFUPDATE sTotalPrice = getGlobalSalePrice(cdbl(sTotalPrice)) End If If Application("AppName") = "StoreFrontAE" Then 'SFAE sTotalPrice = ApplyALLDiscounts(cdbl(sTotalPrice),"Total") '.3008 End If '----------------------------------------------------------- ' SUBTOTAL OUTPUT '----------------------------------------------------------- %> <%OVC_ShowOrderDiscounts'SFAE%> <% ' End rsAllOrders If End If %>
Sub Total: <% If iConverion = 1 Then dim stemp stemp = "" dblTotal = FormatCurrency(sTotalPrice) Response.Write stemp Else If sTotalPrice < 0 Then Response.Write "Error: Your SubTotal Was a Negative Amount" Response.End Else dim dblTotal dblTotal = FormatCurrency(sTotalPrice) Response.write FormatCurrency(sTotalPrice) End If End If %>   
"> "> "> "> "> "> <% If iSaveCartActive = 1 Then if Application("AppName")="StoreFrontAE" then%>

View Wish List <% else %> View Saved Cart <% End If %> <% End If %> <% ' See if there is any path to return to If Request.Cookies("sfSearch")("SearchPath") <> "" Then sSearchPath = Request.Cookies("sfSearch")("SearchPath") If InStr(LCase(sSearchPath), "login.asp") <> 0 Then sSearchPath = "search.asp" End If Else sSearchPath = "search.asp" End If %> <%If bHasProducts Then %>

Continue Shopping

Please Note: CHECKOUT will go to our secure server to finish your transaction. <% Else %> Continue Search <% End If %>

 

Contents Copyright 2003 Deck Building with Kwikdek.  All Rights Reserved
Web Site E-Commerce Brought to you by Cedar City Sidewalk

<% closeObj(rsAllOrders) closeObj(cnn) %>