<%Option Explicit%> <% const xkitTemplate="tmp_kit.htm" '************************************************************************************************************************ ' This page displays the features for a product so that the buyer ' can configure the product to their requirements. * '************************************************************************************************************************ ' Release ** Date ' Version 6.50 ** June 29, 2005 ' April 26, 2005 add translate '------------------------------------------------------------------------------------------------------------------------ Dim dbc Dim ProductCode Dim ProductName Dim CatalogID 'From QueryString Dim ProductFeatures Dim ProductPrice Dim ProductImageURL Dim ProductDescription Dim ProductCategory Dim ProductCatalog dim Productweight Dim sKitScript Dim sFeatureScript Dim sKitFeatureLabels Dim DollarSign Dim DecimalPoint Dim SelectList Dim FeaturePrice dim Featurepercent Dim FeatureType Dim FeatureCaption Dim FeatureNum Dim FeatureLabel Dim FeatureKey Dim FeatureOther1 Dim FeatureRequired Dim LastFeatureNum dim strfeaturedefault dim DefFeatureKey Dim SelFeaturePrice Dim FeatureMulti Dim FeatureIndex Dim SelFeatureLabel ShopPageHeader ' normal page header SetSess "CurrentUrl","shopkitconfig.asp" Init shopopendatabaseP dbc LoadProductDetails If Not HasValue(serror) then BuildFormLayout ShopPageTrailerKit ' normal trailer else handleerror serror end if shoppagetrailer shopclosedatabase dbc '*********************************************************************************************************************** 'SUBROUTINES AND FUNCTIONS '*********************************************************************************************************************** '------------------------------------------------------------------------------------------------------------------------ 'Main logic subroutines for building the configurator. They call subroutines and functions from the code sections below 'to build the layout of the page and to build the page level script that executes against the common code in shopkitscript.htm. '------------------------------------------------------------------------------------------------------------------------ sub BuildFormLayout sql = CreateSQL StartForm AddHiddenProdFields response.write tabledef StartScript set objrs= dbc.execute(sql) If not objRS.EOF Then If HasValue(SelectList) Then ProcessSelectListType Else ProcessStandardFeatureType End If closerecordset objrs Else closerecordset objRS shopclosedatabase dbc shoperror "Product has no features configured." End If EndForm End Sub '------------------------------------------------------------------------------------------------------------------------ Sub ProcessStandardFeatureType Do While Not objRS.EOF PrimeFeatureNum StartScriptForFeatureKey StartFeatureLayout do while objRs.Fields("featureNum").value = lastfeaturenum LoadFeatureKeyValues ProcessScriptForFeatureNum AddFeatureValue FeatureKey, featureLabel, featureCaption objRS.MoveNext FeatureIndex = FeatureIndex + 1 LastFeatureNum = Featurenum if objRS.EOF then exit do Loop EndScriptForFeatureKey FinishFeatureOption Loop FinaliseScript End Sub '------------------------------------------------------------------------------------------------------------------------ Sub ProcessSelectListType Dim aTemp: aTemp = Split(SelectList, ",") Dim j PrimeFeatureNum StartScriptForFeatureKey StartFeatureLayout 'loop through each select list value for j = 0 to UBound(aTemp) LoadFeatureKeyValuesForSelectList aTemp(j), j ProcessScriptForFeatureNum AddFeatureValue FeatureKey , featureLabel, featureCaption Next EndScriptForFeatureKey FinishFeatureOption 'Close of the option type (radio, checkbox, select) FinaliseScript End Sub '----------------------------------------------------------------------------------------------------------------------- 'Subroutines for Adding features to the form '----------------------------------------------------------------------------------------------------------------------- Sub ShopPageTrailerKit response.Write vbCrlf & "