Ecommerce Module Design

by Sarah Ewen

I. Essentials

  • Main procedures:
/tcl/ecommerce-defs.tcl
  • Procedures related to credit card transactions:
/tcl/ecommerce-credit.tcl
  • Procedures related to sending emails:
/tcl/ecommerce-email.tcl
  • Procedures related to calculating total order prices:
/tcl/ecommerce-money-computations.tcl
  • Scheduled procedures:
/tcl/ecommerce-scheduled-procs.tcl
  • Procedures related to order state changes:
/tcl/ecommerce-state-changes.tcl
  • Procedures related to page styles:
/tcl/ecommerce-styles.tcl
  • Procedures related to user activity tracking:
/tcl/ecommerce-user-contributions-summary.tcl
  • Utility procedures:
/tcl/ecommerce-utilities.tcl
  • Procedures related to interface widgets:
/tcl/ecommerce-widgets.tcl

II. Introduction

What the Ecommerce Module is For

The ecommerce module is designed to give a web site all the functionality that you would expect from any large web site that sells products to its online community (e.g., www.amazon.com). It is intended to provide all the utilities that an ecommerce web site is likely to need, including:

Additionally, it is intended to be used with the customer service module, which was written to provide all the customer service functionality that the ecommerce module requires, namely: customer issue and interaction tracking.

The ecommerce module is designed to allow the shop to operate in either of the following ways:

  1. The web site owner is the retailer
  2. All the orders made on the site are sent to one retailer

With (a lot of) customization, it can also be set up to handle ordering products from multiple retailers.

The next version will account for another way of doing business: having multiple retailers set up their own shop on your ecommerce site, a bit like store.yahoo.com.

What It Isn't For

At present, you can't allow retailers to build their own stores on your site, as mentioned above. Also, it is not designed for small sites: the ecommerce module is aimed at large online communities selling thousands of products. If you just want to sell a handful of items and not build a full online community, you're probably better off starting with ArsDigita Shoppe, downloadable from http://arsdigita.com/free-tools/shoppe.

If you want to sell conference or course registration, use the events module (www.arsdigita.com/events). This code has been used to process thousands of course and marathon registrations.

III. Historical Considerations

Most of the considerations that influenced the ecommerce module were associated with specifications for client work. When the ecommerce module was written, there were certain requirements that influenced the design that was adopted and the features that were included, such as having three levels of depth in the product category tree. (When you think about it, having more than three levels of product categories is going to make browsing tiresome for customers - going down, down, down again, down, then up, back up, up, down, oops wrong one! up again, down again...).

Take a look at "Design Decisions" for the details on how everything works, and why.

IV. Competitive Analysis

There are a number of products out there that provide roughly the same services as the ecommerce module. The most notable of these are:

Rather than stepping laboriously through each individual feature that both have to offer, the following attempts to highlight interesting contrasts between the ecommerce module and the other products.

BroadVision

ArsDigita Ecommerce Module BroadVision
Customers can comment on products
Admins approve/disapprove comments
Threaded message boards
Customers can give products ratings System recommends which discussion boards user should join, based on history
Administrators submit professional review of products; choose whether to display them Can create on-the-fly product comparisons
Customers save, view and retrieve shopping carts Customers can save shopping lists as well as shopping carts
Admins can view all products in one list; users can view lists of products per category or use a search Customers can view site wide lists of products
Admins can query for users based on their ACS history and send them gift certificates or emails Incentive programs can be loaded from exogenous business systems
Admins create user classes and can have `look and feel' templates and promotional offers associated with them "Contract Wizard" creates specific sets of products and prices for each company that accesses the web site.
Page templates can be created & saved, and then associated with user classes or products Provides content scheduling
Templates are written in HTML and can have ADP code; not compulsory but allows for very flexible and customized pages. No need to muck about in Tcl or SQL. Integrated with DreamWeaver; no need to understand technical underpinnings

BroadVision vs ACS ecommerce module: Conclusion

BlueMartini

ArsDigita Ecommerce Module BlueMartini
Integrated into the ArsDigita Community System 13 modules offering different aspects of ecommerce
Can take advantage of CRM module and the customer service module (specially developed for the ecommerce module) in the ACS Very focussed on customer management and customer targeting; extensive utilities
Customer service module developed for tracking issues customers raise and all interactions with customer services until they are resolved Call center for taking orders and managing them.
Collects information from interaction with community web site Collects information from users' purchasing and browsing history; `customer event stream behavior'
Use of ACS bulletin boards, discussion forums, community services Facility for customer collaboration whilst browsing products, real time chat
Admins save templates for use at any time, new templates can be created based on existing ones Content management versioning system
Admins have access to full searching capabilities of ACS; graphing module can be utilized to produce graphical representations of the results with some programming Data mining module offers multidimensional graphing of mining results
Admins create classes of users that they wish to define; users can be given the right to add themselves to these classes directly Personalization implemented through `business rules' that can be generated using a `rules induction' algorithm

BlueMartini vs ACS ecommerce module: Conclusion

Oracle iStore

ArsDigita Ecommerce Module Oracle iStore
Integrated into the ArsDigita Community System; offers customer service and order management as one package Integrates with Oracle ERP applications and the Oracle Call Center & telephony suite for order management and extended customer care
Admin-defined user classes that can be associated with product look and feel templates, and promotions Personalization; merchant-defined options
Customers have to contact customer service reps and talk to them nicely about canceling orders Customers can cancel orders online.

Oracle iStore vs ACS ecommerce: Conclusion

Akopia Tallyman

ArsDigita Ecommerce Module Akopia Tallyman
Can include ADP and product variables in page templates Can include perl in page design
Provides sales, order fulfillment, customer service, reports Focuses on sales and fulfilling orders. No customer service. Very basic reports on orders and site traffic.
Customers can save, view & retrieve shopping carts Customers cannot save shopping carts
Look and feel of the site changes depending upon user classes that the user may belong to Site cannot be customized per user
Extensive documentation On-line help
Custom fields for each new product type All product fields are pre-defined

Akopia Tallyman vs ACS ecommerce: Conclusion

Dynamo Commerce System

ArsDigita Ecommerce Module Dynamo Commerce System
Offers one default template and the ability to write more in HTML and ADP Offers pre-built templates with the system and a templating `wizard' for designing more, not a language.
Different users can be offered special promotions; these are offered when browsing the site. Customers have their own `Your Account' page which shows them their entire order history and all the mailing lists they are subscribed to. Customers can have their own home page with their recent order history, products they bought recently and special promotions.
Executes credit card authorization and billing in real time. Offers a highly configurable `order processing pipeline' which must interface with third party software to make payments.

Dynamo Commerce System vs ACS ecommerce: Conclusion

In summary

There are a small number of features which competitor products offer, such as:

which the ecommerce module does not currently accommodate.

However, none of these products completely encapsulate the functionality of the ecommerce module, and any shortcomings are more than compensated for by the ecommerce module's tight integration into the ACS. Because the ACS offers such powerful access to information that can quickly be used to build an all-round complete profile of the user, it can offer a much more accurate picture of the site's customers.

Another powerful advantage of using the ecommerce module is the simple fact that it is an open source solution. Whilst Akopia's Tallyman is open source too, the functionality they offer is not as complete (it's very pretty though), and at the end of the day it will still just be an ecommerce package rather than an complete collaborative commerce system.

V. Design Decisions: How Things Work

This section describes the way that placing an order and purchasing a gift certificate has been implemented. It also outlines the tasks will be need to be performed for a bare minimum level of maintenance.

Orders

These are the states that an order can go through:

   +-------- IN_BASKET <----------------+ (if authorization fails --
   |            |                       | it might also temporarily go
   |            |                       | into FAILED_AUTHORIZATION
EXPIRED      CONFIRMED------------------+ before returning to IN_BASKET)
                |
          +-----+------------+
          |                  |    
 AUTHORIZED_MINUS_AVS   AUTHORIZED_PLUS_AVS
          |                  |
          +----+--------+----+
               |        |
PARTIALLY_FULFILLED--->FULFILLED
                          |
                       RETURNED

An order can also be put into the VOID state at any time by the site administrator. (Note: these states are actually stored in all lowercase in the database, but it's clearer to use uppercase letters in the documentation).

An order is IN_BASKET when the customer has put items into their shopping cart on the site but has not indicated an intent to buy (if they stay there too long they go into the EXPIRED state; "too long" is defined in the parameters/yourservername.ini file; default is 30 days). When the customer submits their order, the state becomes CONFIRMED. Only then do we try to authorize their credit card. If the authorization succeeds, the order state will be updated to AUTHORIZED_PLUS_AVS or AUTHORIZED_MINUS_AVS. AVS stands for Address Verification System (for more information on AVS, read the ecommerce chapter of Philip & Alex's Guide to Web Publishing). Because AVS is flaky and unreliable, we treat AUTHORIZED_PLUS_AVS orders the same as AUTHORIZED_MINUS_AVS orders. If an order fails, it goes back into the IN_BASKET state and the customer is given another chance to enter their credit card information.

Problems occur if we don't hear back from CyberCash or if they give us a result that is inconclusive. In cases like this, the order state remains in the CONFIRMED state. A scheduled procedure sweeps the database every once in a while looking for CONFIRMED orders that are over 15 minutes old and tries to authorize them. If the authorization succeeds, the order is put into the AUTHORIZED_PLUS_AVS or AUTHORIZED_MINUS_AVS state. If it fails, it is temporarily put into the FAILED_AUTHORIZATION state so that it can be taken care of by a scheduled procedure which sends out email to the customer saying that we couldn't authorize their order and then saves the order for them (a saved order is one in the IN_BASKET state with saved_p='t'; it can be retrieved easily by the customer later).

Once an order is authorized it is ready to be shipped. An order which has some of its items shipped is PARTIALLY_FULFILLED and an order which has all of its items shipped is FULFILLED. It remains in the FULFILLED state unless all of the items in the order are returned, at which time it becomes financially uninteresting and goes into the RETURNED state.

Individual items in an order also go through a series of states:

IN_BASKET -----------+
   |                 |
TO_BE_SHIPPED     EXPIRED
   |
SHIPPED
   |
ARRIVED
   |
RECEIVED_BACK
An item starts out in the IN_BASKET state. When the order it's in becomes authorized, the item becomes TO_BE_SHIPPED. Because partial shipments can be made on orders, SHIPPED is a state of the individual items, not of the order. There is currently no mechanism for putting an item into the ARRIVED state but it could be used if you were to set up a method of data exchange with FedEx's database to get the actual arrival date and arrival detail for each of the packages you ship. If the customer returns an item to you, it is put into the RECEIVED_BACK state. Like orders, individual items can also be put into the VOID state (e.g. if the customer changes their mind or if you run out of stock before you can ship it).

What can be done with orders?

On an individual order:

Gift Certificates

Whether or not customers are allowed to order gift certificates is configurable in the parameters .ini file. These are the states that a purchased gift certificate goes through:

                        CONFIRMED
                            |
        +-------------------+---------------------+
        |                   |                     |
AUTHORIZED_PLUS_AVS   AUTHORIZED_MINUS_AVS   FAILED_AUTHORIZATION
Regardless of whether you allow customers to purchase gift certificates, you can always issue gift certificates to your customers. Gift certificates that you issue automatically go into the AUTHORIZED state.

There are a few fundamental ways in which purchased gift certificates differ from assigned gift certificates. Purchased gift certificates are sent to some recipient who may or may not be a registered user of the system, along with a claim check. These gift certificates must be claimed upon order checkout in order to be used. Issued gift certificates, on the other hand, are given to registered users of the system and are put directly into their gift certificate balance. There is no need for them to be claimed because there is no ambiguity about who the gift certificates belong to.

All gift certificates have an expiration date (this is necessary so that your liability has a definite ending point). A customer's gift certificate balance is equal to the sum of all the unused portions of each non-expired gift certificate they own. When their gift certificate balance is applied toward a new order, the gift certificates that expire soonest are the first to be applied.

What can be done with gift certificates?

Site Upkeep

Besides the most important task of filling orders, there are some other things that need to be done occasionally.

Dealing with Problems

A log of potential problems is maintained by the system when it comes across issues that it is unable to resolve. These (typically infrequent) problems will need to be resolved by hand.

VI. The Data Model

Big, Friendly Giant

The ecommerce data model is pretty big, but it isn't scary. The majority of the tables are audit tables for tracking activity when data is entered or modified. Everything is well commented, so reading through it should not be too painful at all.

The interesting tables that you might want to look at are:

Hooking up with the Customer Service Model

Note that the customer service module is designed to be used in conjunction with the ecommerce module (something that we definitely recommend, as you will want to track your users problems efficiently, or else they will leave you). The columns order_id and gift_certificate_id in the ec_customer_service_issues table should reference the ec_orders and ec_gift_certificates table respectively.

VII. Transactions & Implementation Details

There are many legal transactions that take place in this module; enough for a book in itself. Perhaps a more useful thing to know how a few things are handled under the hood. This section covers the implemented details for:

VIII. API

All the ecommerce procedures are defined in /tcl/ecommerce-*.tcl and /www/arsdigita/doc/sql/ecommerce-plsql.sql, and are pretty well documented. Here are a few useful ones:
Function Name and File
Returns the remaining balance of a gift certificate. ec_gift_certificate_balance in ecommerce-plsql.sql
Checks that a credit card number is well-formed. ec_creditcard_precheck in /tcl/ecommerce-credit.tcl
Removes credit card numbers for orders that are FULFILLED, RETURNED, VOID, or EXPIRED. ec_remove_creditcard_data in /tcl/ecommerce-scheduled-procs.tcl
Determines the lowest price that a given user is entitled to receive based on what user classes they're in and what offer_codes they came to product with ec_lowest_price_and_price_name_for_an_item in /tcl/ecommerce-money-computations.tcl
Returns the total price for an order, given an order_id without shipping, tax, or gift certificates ec_total_price in ecommerce-plsql.sql
Returns the status of an order for a customer ec_order_status in /tcl/ecommerce-utilities.tcl

IX. User Interface

Considerations for the user

The most important issues that played a part in deciding how the ecommerce module's interface should be structured were accessibility and consistency.

Accessibility means, in more specific terms:

The addition of the product recommendations feature also improves the quality of the user interface. Because products can be split into categories, there is a danger that users may pass by a category completely and never become aware of the items that are for sale. Per-category product recommendations provide a way around this by 'pushing' good products to the top of the pile for the user to notice.

Considerations for the site-wide administrator

The admin index page offers links to all the areas of administration in the ecommerce module, but more importantly displays one key statistic relevant to that area, so that administrators can instantly see if there is a particular area that requires attention, e.g. there is 1 unresolved problem with the site. This extra information makes it much easier to check over the status of the site `at a glance', whilst not interfering with the purpose of the index page.

Areas that might be handled by different people have been kept together, to save administrators having to `jump about' from one set of links off the index page to another. All order information, including reports, is found under the `Orders / Shipments / Refunds' section.

The user interface was otherwise designed based on what had been successful on other ecommerce web sites, and the specifications of clients who we had in mind when designing the ecommerce module.

X. Configuration Parameters

The following items need to be installed / configured / executed before the ecommerce module will work properly:

To get the ecommerce module up and running, you will need to perform the following tasks. See the requirements document user scenarios for how this is done.

  1. Set up product categorization (/admin/ecommerce/cat/)
  2. Set up your shipping cost rules (/admin/ecommerce/shipping-costs/)
  3. Set up your sales tax rules (/admin/ecommerce/sales-tax/)
  4. If desired, add custom product fields at /admin/ecommerce/products/custom-fields.
  5. Create new product display templates at (/admin/ecommerce/templates/)
  6. Set up user classes (/admin/ecommerce/user-classes/)
  7. Enter your products into the database either using the form at /admin/ecommerce/products/add or the bulk uploader utilities at /admin/ecommerce/products/upload-utilities.
  8. After you've added a product, there are a variety of things you can do to it, such as:
  9. Add product recommendations (/admin/ecommerce/products/recommendations).
  10. Modify the email templates (/admin/ecommerce/email-templates/), which are used when the system sends out automatic email to customers.
  11. The layout for all the pages in the site is created using templates which are stored in the directory /web/yourservername/templates/ecommerce/ (with the exception of product which, as discussed above, uses a different templating system to allow for different templates for different products). If you are unhappy with the look of any of the pages in your site, there's a good chance that it can be changed simply by editing the corresponding template.

XI. Acceptance Tests

After you have completed the setup tasks in Technical Details of the Ecommerce Module, here are some good tests of the things most likely to be broken: Once all this is working, you can further test your system:

XII. Future Improvements/Areas of Likely Change

The ecommerce module is intended to have the all following features integrated into it:

XIII. Authors

The ecommerce module was designed and implemented by Eve Andersson. Eve is the owner of the ecommerce module for all pre-4.0 versions of the ACS; when it moves to version 4.0 Eric Lorenzo will be taking ownership of the project.

The original documentation was also written by Eve; it has been updated, reformatted and augmented by Sarah Ewen.

XIV. Revision History

Document Revision # Action Taken, Notes When? By Whom?
0.1 Creation, based on /arsdigita/doc/ecommerce-technical and /arsdigita/doc/ecommerce-operation 10/12/2000 Sarah Ewen
0.2 Reviewed in light of Eve Andersson's comments. 10/15/2000 Sarah Ewen


acs-docs@arsdigita.com

Advertisements