<% '************************************************************************* ' ASP Scripting: ' Filename: view_shopping_cart.asp ' Written by: Wilbert Madarang ' Date: May 7, 2003 '************************************************************************* ' Description: Views the contents of the Shopping Cart '************************************************************************* ' Revision History: '************************************************************************* %> View Shopping Cart - Charister.com

<% Call PrintShoppingCartContents %> <% Call PrintPromoCode %> <% Call PrintShoppingCartLinks %>
<% '************************************************************ ' Function: PrintShoppingCartContents ' Description: Prints the Shopping Cart contents ' Date: May 9, 2003 ' Written By: Wilbert Madarang '************************************************************ ' Modified by: Wilbert Madarang ' Date: November 1, 2003 ' Description: Modified the order of presenting Product Info: ' - ProductName, Price, Color, ProductCode '************************************************************ Function PrintShoppingCartContents Dim nNumItems, aryShoppingCart, nProductRegularPrice, nProductSalePrice, nProductPrice, nTotalPrice Dim strProductId, strProductCode, strProductName, strQuantity, strProductRegularPrice, strProductSalePrice, strProductColor Dim strCurrencyLabel Dim strInstock 'Tbd: change strInstock to come from DB. strInstock = "In Stock" 'Write Shopping Cart Header Response.Write "In Your Shopping Cart" & vbCrLf& vbCrLf 'Write Query Headers in Table Format Response.Write "" & vbCrLf Response.Write "
" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf 'Print Shopping Cart Contents nNumItems = Session( "NumShopItems" ) aryShoppingCart = Session( "MyShoppingCart" ) For i = 1 to nNumItems strProductId = aryShoppingCart( i, SCART_PRODUCT_ID ) strProductCode = aryShoppingCart( i, SCART_PRODUCT_CODE ) strProductName = aryShoppingCart( i, SCART_PRODUCT_NAME ) strQuantity = aryShoppingCart( i, SCART_QUANTITY ) strProductRegularPrice = aryShoppingCart( i, SCART_REGULAR_PRICE ) strProductSalePrice = aryShoppingCart( i, SCART_SALE_PRICE ) strColor = aryShoppingCart( i, SCART_PRODUCT_COLOR ) 'Convert Numeric Variables strCurrencyLabel = GetCurrencyLabel() nQuantity = CInt( strQuantity ) nProductRegularPrice = CCur( strProductRegularPrice ) nProductSalePrice = CCur( strProductSalePrice ) nProductPrice = getProductPrice( nProductRegularPrice, nProductSalePrice ) nTotalPrice = nQuantity * nProductPrice 'Write Item Column Response.Write "" & vbCrLf Response.Write "" & vbCrLf 'Write Quantity Column Response.Write "" & vbCrLf 'Write In-stock Response.Write "" & vbCrLf 'Write Total Price Response.Write "" & vbCrLf 'Write "Remove Item" Response.Write "" & vbCrLf Next Response.Write "
ItemsQtyStatusTotalModify
" & vbCrLf 'ProductName Response.Write "" & strProductName & "
" & vbCrLf 'Price Response.Write "Price: " & strCurrencyLabel & FormatCurrency(strProductRegularPrice, 2) & "
" & vbCrLf If ( strProductSalePrice ) > 0 Then '******************************************** ' Added by WM, November 24, 2003 ' Added Red Color to Sale '******************************************** Response.Write "" & vbCrLf Response.Write "Sale: " & strCurrencyLabel & FormatCurrency(strProductSalePrice, 2) & "
" & vbCrLf Response.Write "
" & vbCrLf '******************************************** ' End of Addition by WM, Nov 24, 2003 '******************************************** End If 'Color If strColor = "" OR IsNull(strColor) Then Else Response.Write "Color: " & strColor & "
" & vbCrLf End If 'Product Code Response.Write "Product Code: " & strProductCode & "

" & vbCrLf Response.Write "
" & strQuantity & "
" & strInstock & "" & strCurrencyLabel & FormatCurrency( nTotalPrice, 2) & "" & vbCrLf Response.Write "
" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "
" & vbCrLf End Function '************************************************************************* ' Function: getProductPrice ' Description: gets the Product Price ' Parameters: regular price, sale price ' Returns: returns the price ' Written by: Wilbert Madarang ' Date: May 7, 2003 '************************************************************************* 'Function getProductPrice( nProductRegularPrice, nProductSalePrice ) ' Dim nProductPrice ' ' If ( nProductSalePrice ) > 0 Then ' nProductPrice = nProductSalePrice ' Else ' nProductPrice = nProductRegularPrice ' End If ' getProductPrice = nProductPrice 'End Function '************************************************************ ' Function: PrintPromoCode ' Description: Prints the Promotion Code Input Box ' Date: May 9, 2003 ' Written By: Wilbert Madarang '************************************************************ Function PrintPromoCode Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "If you have a promotional code, please enter it here: " & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf End Function '************************************************************ ' Function: PrintShoppingCartLinks ' Description: Prints the Shopping Cart Links ' Date: May 9, 2003 ' Written By: Wilbert Madarang '************************************************************ Function PrintShoppingCartLinks Dim strPrevUrl strPrevUrl = Request.ServerVariables("HTTP_REFERER") ' Response.Write "CONTINUE SHOPPING" & vbCrLf 'if strPrevUrl = "http://www.charister.com/new-charister/view_shopping_cart.asp" then 'If InStr(strPrevUrl, "view_shopping_cart.asp") > 0 Then 'ay053005 update to go to the collection page ' strPrevUrl = "view_bed_linen_patterns.asp?product_line_id=1&page=1" strPrevUrl = "view_bed_linen_collection_default.asp?product_line_id=1&page=0" 'End if Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf ' Response.Write "CONTINUE CHECKOUT" & vbCrLf Response.Write "" & vbCrLf Response.Write "" & vbCrLf Response.Write "
" & vbCrLf Response.Write "
" & vbCrLf Response.Write "
" & vbCrLf Response.Write "
" & vbCrLf Response.Write "
" & vbCrLf End Function %>