<%@ Language=VBScript %> <% '************************************************************************* ' DO NOT MODIFY THIS SCRIPT IF YOU WANT UPDATES TO WORK! ' Function : Options Groups Maintenance ' Product : CandyPress Store Administration ' Version : 2.5 ' Modified : February 2004 ' Copyright: Copyright (C) 2004 CandyPress.Com ' See "license.txt" for this product for details regarding ' licensing, usage, disclaimers, distribution and general ' copyright requirements. If you don't have a copy of this ' file, you may request one at webmaster@candypress.com '************************************************************************* Option explicit Response.Buffer = true const adminLevel = 1 %> <% 'Database dim mySQL, cn, rs 'OptionsGroups dim idOptionGroup dim optionGroupDesc dim optionReq dim optionType dim sortOrder '************************************************************************* 'Open Database Connection call openDB() 'Store Configuration if loadConfig() = false then response.redirect "sysMsg.asp?errMsg=" & server.URLEncode("Could not load Store Configuration settings.") end if 'Set Row Colors dim rowColor, col1, col2 col1 = "#DDDDDD" col2 = "#EEEEEE" %>

Option Group Maintenance

<% 'Page Tabs call optTabs("OG") if len(trim(Request.QueryString("msg"))) > 0 then %> <%=Request.QueryString("msg")%>

<% end if %>
Add New Option Group

<% rowColor = col1 %> <% rowColor = col2 'Retrieve all Option Groups mySQL="SELECT a.idOptionGroup,a.optionGroupDesc," _ & " a.optionReq,a.optionType,a.sortOrder," _ & " (SELECT COUNT(*) " _ & " FROM optionsXref b " _ & " WHERE b.idOptionGroup = a.idOptionGroup) " _ & " AS OptionCount, " _ & " (SELECT COUNT(*) " _ & " FROM optionsGroupsXref c " _ & " WHERE c.idOptionGroup = a.idOptionGroup) " _ & " AS ProductCount " _ & "FROM OptionsGroups a " _ & "ORDER BY a.optionGroupDesc" set rs = openRSexecute(mySQL) do while not rs.eof %> <% rs.movenext 'Switch Row Color if rowColor = col2 then rowColor = col1 else rowColor = col2 end if loop %> <% call closeRS(rs) %>
 
ID Description Sort Type Req Opt Prod  
<%=rs("idOptionGroup")%> <%=rs("optionGroupDesc")%>  <%=emptyString(rs("SortOrder"),"-")%> <%=rs("optionType")%>  <%=rs("optionReq")%>  <%=rs("optionCount")%>  <%=rs("productCount")%>  [ ">edit | <% if rs("OptionCount") > 0 or rs("ProductCount") > 0 then %> delete <% else %> ">delete <% end if %> ]
 

Help and Instructions :
Overview - An Option Group is a collection of one or more options, grouped together under a common name. Once an option group has been created, it is then linked to one or more Products using the Product Maintenance function.

Option Groups can be displayed as follows :
  1. Drop-down select box containing one or more options.
  2. Radio Button list containing one or more options.
  3. Text box into which the customer enters additional text.
In the example below, the option groups "Color" and "Size" will be displayed as drop-down select boxes allowing the the customer to select a "Color" and/or "Size" from a list. The "Printed Text" option group is a text box into which the customer can enter the text they want to have printed on the T-Shirt.

An option group can be made mandatory. This will ensure that a customer has to pick one of the options in a list, or enter some text into a text box before they add a product to their shopping cart.

Example :
  • T-Shirt
    • Color
      • White
      • Red
      • Blue
    • Size
      • S
      • M
      • L
      • XL
    • Printed Text
      • <Text entered by customer>
NOTE : You can not delete option groups that have options or products linked to them. You will need to delete the options or products first (or un-link them from the option group). You can see the number of options and products linked to an option group under the heading "Opt" and "Prod".

<% call closedb() %>