FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Architecture & Design
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
January 01, 2002

Lab Note | Electronic Commerce with SoftCart (Web Techniques, Oct 1996)

(Page 5 of 5)
Lab Note | Electronic Commerce with SoftCart (Web Techniques, Oct 1996)

Electronic Commerce with SoftCart

By Chris Baron

Online shopping is becoming commonplace as Web stores, I-malls, and electronic shopping boutiques spring up across the Web. Often the electronic shopper will collect his treasures in a virtual shopping cart, an efficient and familiar way for users to do their shopping. In the early days (1995), virtual-shopping-cart systems were either custom built or created using freely available but minimally supported freeware components. This approach was fine for rugged pioneers blazing trails in Web commerce, but a new generation of Web tenderfeet demands solid, commercially supported products to build their online stores.

Mercantec FigureSoftCart v2.10 (www.mercantec.com) aims to answer this need. With a list price of $895, plus an optional $175 annually for support, SoftCart is definitely not aiming at helping Junior sell his baseball-card collection over the Web. Compared to the cost of a custom-programmed system, however, SoftCart's price tag is quite reasonable. Targeted toward professional developers and ISPs, the clean architecture and simple configuration allow any Web developer with a site or two under his belt to create an online storefront quickly and easily. No knowledge of CGI, Perl, or C programming is needed. What's in the Box?

In a word, nothing. SoftCart is distributed in electronic form, although a boxed version is in the works. After purchase, the single, binary, executable file for your Web server is sent to you via email. I received an evaluation copy the day after I requested it. Documentation consists of an 85-page user's manual—available in Microsoft Word and Adobe Acrobat format—that gives detailed instructions on configuring the system and setting up a store. A set of examples and templates is also available from the Mercantec Web site. Most of the documentation is centered around setting up the supplied example store, but enough general guidance is there to help you set up your own site. Using the included example store as a starting point, you can easily create a simple, custom storefront in a day. SoftCart is the first system I've seen to offer built-in support for the Cybercash (www.cybercash.com/) credit-card payment system. Mercantec also supports the CheckFree, Digicash, and First Virtual systems. Support is promised for the new Visa/Mastercard payment system, once it is released.

Unlike some of its competitors, SoftCart is written in ANSI C for performance and cross-platform compatibility. The simplicity of the CGI specification allows SoftCart to support a wide range of operating systems and platforms, including Windows 95/NT, BSDI, OSF/1, DEC UNIX, HP/UX, SCO UNIX, SGI IRIX, and Sun OS. At my request, Mercantec also sent me the source and a makefile to compile the program under Linux and FreeBSD. All Web servers that conform to the CGI standard on the above platforms are supported.

I had only a minor complaint with the SoftCart distribution. Although the documentation is extensive and covers most features of the system, I would have liked to see a tutorial or a little more hand-holding for beginners. Some troubleshooting advice specific to common Web servers and operating systems would have also been welcome. Finally, no example of using the Cybercash system is provided.

A Peek Under the Hood

The HTTP and CGI protocols are designed to provide connectionless and stateless communications between the Web server and browser. In other words, each request for an HTML page or graphic image is an independent transaction without knowledge of the past or present state of the browser being maintained by the Web server. This is the exact opposite of what is needed for a shopping-cart system. To maintain the state of the user's shopping cart, SoftCart uses a technique Mercantec calls StateTrack to create a unique cart id and associated shopping-cart file on the Web server. By inserting this cart id into the form ACTION= tags and HREF= CGI calls into HTML pages sent to the browser, SoftCart can identify the user and manipulate the contents of the shopping cart as desired. The shopping-cart file remains on the server until deleted by the shopper—either explicity or via ordering—or by the system administrator, so users have the ability to bookmark a page in the store and return later to continue shopping. A cart-killer daemon utility is provided for automatic deletion of cart files older than a specified age.

Figure 1 shows a diagram of the SoftCart system. As the user navigates the pages within the store environment, all HTML pages are generated via a CGI call to the SoftCart executable program vsc, which scans the source file for special tags and substitutes the appropriate CGI calls within the page as it is sent back to browser. Figure 2 shows an HTML file as it resides on the server and the HTML code as generated by vsc for display on the browser. You can see the cart id and path to the vsc executable inserted into the HREF= parameter of the anchor tags. Figure 3 shows the file as displayed by the browser.

SoftCart uses tab-delimited ASCII text files to hold the product database, sales-tax tables, and shipping tables. Creation and maintenance of these files requires only a text editor—no database-management system is used. This approach is optimized for stores with a small to medium number of products. Large stores with thousands of products will likely see performance problems since searching the product database doesn't use any of the indexing and hashing functions a database-management system provides. Figure 4 shows the structure of the product database, shipping file and sales-tax file. SoftCart supports several models to calculate shipping charges by weight, quantity, line item, and null (no) shipping. Sales tax is calculated either on the purchase price or on the purchase price plus the shipping charges (y or n in the tax file). Both shipping and sales-tax files may have an unlimited number of categories. The variety of shipping models and the flexible sales-tax categories allow store developers to use existing business rules rather than forcing them to conform to the shopping-cart system.

Pages within the store are designed and created using any standard HTML editor; no restrictions are placed on the design of the page or the elements used. The cart display tags are simply placed in the source file where the shopping-cart contents are to appear. SoftCart detects the browser type and inserts either table codes or preformatted text as appropriate. The link-actions tags are placed in ACTION= and HREF= parameters. Both form- and link-based pages are supported. The source file shown in Figure 2 is a typical HTML file using SoftCart tags. Table 1 lists the SoftCart display tags and link actions.

The USERPROG# link action allows users with page-generation CGI scripts or htm script libraries to continue to use them. The familiar Web interface is maintained as the user navigates the store, using links created by the vsc program. No special method of shopping is required and full flexibility is retained by the page designer.

SoftCart supports both online and off-line ordering. The default online method is to send the order via email to the store owner following user verification. Up to five email addresses may be specified in the configuration file. The order may also be appended to as many as five different order files. Off-line ordering is done via an order form created for the user on the Web browser. This form is designed to be printed and faxed or mailed to the store owner. Several back-end processing options are supported by SoftCart. The Cybercash payment system is fully integrated and can be activated by a link action tag. After a successful payment authorization, a transaction notation is written to a file on the server indicating the transaction was successful. Inventory, sales, and manufacturing systems can also be called by SoftCart as part of the order process. Order data is sent in user-defined templates to match the input requirements of these systems. This flexibility and completeness in back-end processing are part of what distinguishes SoftCart from its competition.

Kicking the Tires

To evaluate SoftCart, I installed it on both a BSDI UNIX server running Apache (www.apache.org ) and on my desktop Windows 95 machine using the Ilar Concepts Folkweb (www.ilar.com/) server. Installation consists of placing the vsc executable (vsc.exe for Windows), along with the configuration file for the store, in a directory where the Web server will execute CGI programs (commonly /cgi-bin). Creating the configuration file is the trickiest part of the installation, but step-by-step instructions in the documentation make it a straightforward operation. Creating the product database, shipping, and tax files requires only a text editor. The documentation includes a full explanation of each shipping and sales-tax model and shows how to configure the product database to match. Template files are provided showing how to implement each of the shipping models. The included example store gives a concrete view of how to tie everything together. Once the system is configured, creating an electronic store is no more difficult than creating regular HTML pages.

I was able to get the example store included in the support files up and running in about two hours on the UNIX server. On the Windows machine, the program ran the same as on the UNIX server, although a few extra configuration options are needed for a Windows installation. Performance was quite good, with no noticeable delay in page generation. The vsc executable is called each time a page within the store is served, which may cause performance problems on machines with very high loads. Mercantec claims to have customers running sites with high hit rates without problems.

I tested the back-end processing functions for sending the order form via email and writing the orders into a file on the server. Both worked as advertised, as did the off-line order function. Setting up a user-defined output template was also straightforward using the instructions included in the documentation. I was unable to test the Cybercash system since I didn't have it installed.

Bottom Line

Mercantec SoftCart is a solid, commercial-quality product. Definitely priced for the professional market, it offers the support and ongoing development needed by many organizations that don't have time or resources to deal with freeware packages. The simple SoftCart tags and link actions provide powerful functions to manipulate the display and contents of user shopping carts while allowing full flexibility in designing the store. (A good example of SoftCart in action can be found at www.toytropolis.com/.) The documentation is clear and covers all you'll need to get your electronic store up and running. The system is easy to install and configure and should provide more than adequate performance for all but the largest stores.


Chris Baron is technical director at The Hypertising Network (www.hypertising.com/), a full-service Internet marketing firm based in Southern California.

Previous Page | 1 | 2 | 3 | 4 | 5
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK