Create a "Category Chooser" Application

As part of a cross-store product directory, the hosting service must provide an application which allows merchants to categorize their products.

The General Idea

These are the main interfaces and functions required of a category chooser application:

  1. When a merchant clicks the Change button in the category field for a product, ShopSite will call the category chooser application and pass in some values as a CGI query string.
  2. The category chooser application must read from the mall-wide product database to get the names, IDs, and hierarchy of product categories.
  3. The category chooser must present an HTML interface to the merchant so that the merchant can select a category for the product. ShopSite will display this interface within a frame in the standard ShopSite merchant interface.
  4. When the merchant clicks OK or Cancel, the category chooser application must return control to a ShopSite CGI and pass back information such as the ID and name of the category chosen.

The Details

1. Values Passed to the Category Chooser

ShopSite assumes that your application is a CGI program, and will pass in these values in a query string when it calls your application:

returl
The URL of the ShopSite CGI that invoked the category chooser. When the merchant has finished selecting a category, the category chooser application must return control to this CGI. Do not change this value.
retqry
Query string (name/value pairs) to pass back to ShopSite when the merchant has finished selecting a category. Do not change this value.
storeid
The ShopSite store ID.
startcatid
The category ID of the starting point for the category chooser. This value is equal to either the last category picked by the merchant via the chooser, or, if no category has been picked yet, the store default category ID.

Here is an example of the query string passed to the category chooser:

http://myhost/cgi-bin/chooser.cgi?returl=http://myhost/cgi-bin/ss/products.cgi
&retqry=fcn_chooser_return%3Dx&storied=mystoreid&startcatid=1234

2. Reading from the Mall-Wide Products Database

The category chooser application needs to read the list of available categories from the mall-wide products database. It can either read the entire hierarchy at initialization, or it can read interactively as the merchant selects categories and subcategories. The implementation of this aspect of the category chooser is entirely up to the hosting service.

3. The HTML Merchant Interface

The merchant interface to the category chooser appears in a frame within ShopSite. The design for letting merchants navigate and select categories is up to the hosting service, but it should include a way for merchants to indicate that they've finished their selection, such as an OK button, and a way for merchants to cancel.

The category chooser can allow merchants to put their products in multiple categories--that is entirely up to the service provider. The category chooser just needs to pass back the right information to indicate this.

4. Values Passed Back to ShopSite

When the merchant finishes with the category chooser, either by clicking OK or Cancel, the application must pass control back to ShopSite by calling the CGI specified in the returl value and passing in these values as a CGI query string:

The retqry string passed into the category chooser.
status
One of three strings, depending on how the category chooser exited:
  • s - Success. The merchant selected a category and clicked the OK button.
  • c - Cancellation. The merchant clicked the Cancel button.
  • f - Failure.
catid
A unique string (usually numeric) identifying the category that the merchant chose. ShopSite will store this with the product information.

ShopSite does not perform any verification on this string; it simply stores the information and later writes it out to the XML file that is read by the "information harvester" application. If the category chooser application allows merchants to select multiple categories, it needs to set the catid to whatever string the "information harvester" application requires to recognize multiple categories.

catdescr
A displayable string representing the chosen category. ShopSite will store and display this with the product information; it does not verify the string in any way.
message
An error message to display if status=f (failure). Do not include this field for success or cancellation.

Here is an example of a query string passed back to ShopSite by the category chooser:

http://myhost/cgi-bin/ss/products.cgi?fcn_chooser_return=x
&status=s&catid=5678&catdescr=Travel...%20Luggage...%20Trunks


ShopSite Help and Resource Center
April 3, 2003
Give Feedback


ShopSite Shopping Cart Software