macromedia ® ™ DRUMBEAT 2000 eCOMMERCE EDITION Users Guide
Trademarks Macromedia, the Macromedia logo, the Made With Macromedia logo, Authorware, Backstage, Director, Extreme 3D, and Fontographer are registered trademarks, and Afterburner, AppletAce, Authorware Interactive Studio, Backstage, Backstage Designer, Backstage Desktop Studio, Backstage Enterprise Studio, Backstage Internet Studio, DECK II, Director Multimedia Studio, Doc Around the Clock, Drumbeat, Extreme 3D, Flash, FreeHand, FreeHand Graphics Studio, Lingo, Macromedia xRes, MAGIC, Power Applets, Priori
CONTENTS INTRODUCTION Developing an e-Commerce Site. . . . . . . . . . . . . . . . . 7 Paths to e-Commerce Development . . . . . . . . . . . . . . . . . . . . . . . . . . . .8 A Typical e-Commerce Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 Up and Running Fast with eStore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 Secure Transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9 How to Use This Book . . . . . . . . . . . .
CHAPTER 3 Adding and Updating the Shopping Cart . . . . . . . . 91 Configuring the Shopping Cart’s Content. . . . . . . . . . . . . . . . . . . . . . .92 Customizing the Data-Map. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .93 Adding the Shopping Cart SmartElement . . . . . . . . . . . . . . . . . . . . . .100 Adding an Add-to-Cart Button on the Shopping Page . . . . . . . . . . . .102 Displaying Shopping Cart Items on a Page . . . . . . . . . . . . . . . . . . . . .
CHAPTER 7 Merchandising . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135 Setting Up Shopping Cart Adjustments . . . . . . . . . . . . . . . . . . . . . . .136 Setting Up Adjustments for Total Weight, Quantity or Purchase. . . . .137 Ordering Page Interactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .139 Adjustment Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .140 CHAPTER 8 Customizing Quick Store . . . . . . . . . . . . . . . . .
Contents
INTRODUCTION Developing an e-Commerce Site . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The development cycle for each e-Commerce project is unique. If your e-Commerce site has been completely thought out and documented in specifications, you will be applying those requirements and figuring out how you will meet them using DrumbeatTM.
Paths to e-Commerce Development For clarity’s sake, think of the development path as having four main aspects: Identity Delivery Development Maintenance Identity defines the theme, colors, and conventions. Delivery defines the target browser, server platform, security requirements, and, specifically for e-Commerce, the payment method. Maintenance is the upkeep of the site. Of course, never forget your audience. These are the people you want to visit and use the site.
A Typical e-Commerce Flow The Quick Store tutorial and eStore instructional media, such as DrumNotes and Starting Points follow this very typical e-commerce flow. However, you can create any flow you want. As e-commerce matures, there will be better flows discovered and planned. Bear in mind that eStore is as flexible as you make it. 1 The site visitor enters the site and browses or searches for product items. 2 The shopper sees a desired product and adds the item to the shopping cart.
Encryption: Save the check-out pages on a secure server using Secure Sockets Layer (SSL). Database: Make sure the database is not saved in the wwwroot directory on the server. Add a user name and password to the database. Authentication: Protect individual files and folders on Windows NT servers using the Challenge Response authentication. ASP Security: Learn about the difference between server-side and client-side code. To learn about each of these points, see “Security” on page 121.
Minimum: 166Mhz; 128 Megs RAM ASP Enabled SA or MS PostingAcceptor Installed ODBC DSN Creation/Update Methodology Installing Drumbeat 2000 eStore Builder To install StoreBuilder from the CD: 1 Insert the Drumbeat 2000 with eStore Builder, or the eStore Builder CD. The installation program starts automatically, and you will see the eStore Builder Installation screen. 2 From the selections available, choose Install eStore Builder.
Introduction
1 CHAPTER 1 Quick Store Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Quick Store tutorial walks you through the process of building an online store using the eStore Builder components. In this tutorial, you will be building a sample eStore site for an online computer book warehouse using the basic eStore components.
Getting Familiar with Quick Store Starting Point A Drumbeat Starting Point is a project file that has all or part of a site already developed. The Quick Store Starting Point has all the pages for the storefront as well as most of the functionality set up. You will add the Shopping Cart and set up the Login and Checkout areas. Open the Quick Store Starting Point To base a new site on the Quick Store Starting Point: 1 Launch Drumbeat from the Start menu.
Site Structure In the Site tab you can see the site organization. Expand the site tree to expose all the pages in the site. The Home page is designed to present visitors with rotating book specials. If a special catches their eye, they can order it immediately by clicking an order button. Otherwise, visitors can choose to go to one of the three main areas of the site.
Templates Templates speed up the development time by reducing repetitive design tasks. Click the Templates tab and you’ll see that the site has three templates: a Master Template and two section templates: Master Template: This template contains only the link style information for the site. (Select the Master Template in the site tree and then click the Attributes tab to see the names of the assigned link styles.) All pages in the site inherit these styles.
Commerce Template: This template is used for the shopping cart and checkout pages. It contains a background, logo and two linked images for navigation. All of the pages shown under this template in the Templates tab site tree inherit these elements. For more information about templates check the index of the Drumbeat User’s Guide or Help for the words in bold. Content Tables Content Tables organize media as well as give you a visual representation of databases.
The Recordsets used in the Quick Store tutorial have also been created for you. You can view them by querying the Asset Center for site-level elements. Click the Locate Assets button and choose Site Elements > Show all site-level elements. The site-level elements on this site also include the DataForm and Cookies that are used. Notice that each Recordset matches a Content Table in the Content Center (although the names of the Recordsets may differ slightly from the Content Table names).
The description and purpose of each recordset is explained in the following table. Recordset Name Content Table Description BookQuery BookQuery Used in the search, results, and details product pages. From the detail page, the product items are inserted into the Orders table and then carried by the Orders detail and Orders recordsets to the CheckOut pages. CardTypes CreditCardTypes Used on the NewUser and Update User pages to populate the Credit Cards supported.
The custom eStore SmartElements are: Shopping Cart: This component is a server-side object which holds user selections as they shop the store. It manages the data in an online shopping session until they are ready for checkout. Shopping Cart Display: This component is used to display the data contained in the shopping cart, so that users can check the contents of their cart.
eStore Interactions An Interaction is a pre-written JavaScript or VBScript function that can be applied to SmartElements. By selecting SmartElements, you create a contextsensitive list of interactions, from which you can choose the one(s) you want to use. A number of eStore-specific interactions are included in the eStore package. These are added to the Interactions available to you in the Interactions Center and will appear when the appropriate participants are selected.
Not all of the eStore interactions are used in this tutorial, so be sure to check for what’s available when you develop your own online store and want to customize it with advanced features. Also, check the DrumNotes for examples of how to use many of these interactions. If you are new to Drumbeat, you can quickly familiarize yourself with the way interactions are used in the Quick Start Tutorial. For more detailed information, see Chapter 17 in the Drumbeat User’s Guide.
Step 1: Adding A Shopping Cart You will add the heart of the shopping experience by adding and setting up these components: The Shopping Cart server element (referred to as ‘basement element’ in Drumbeat) The Shopping Cart Display element (can also be referred to as ‘page element’ in Drumbeat) The Data-Map which binds the Shopping Cart server and display elements to product, customer, and billing information.
Add the Shopping Cart SmartElement In Site Manager, expand the Search For Books node, and click the Book Detail icon to make its layout active. 1 24 Chapter 1 From the SmartElements Toolbar, select the Shopping Cart SmartElement and drop it on the page. The Basement opens (if not already) and the element appears in the Basement. This element represents the Shopping Cart on the server. Ensure that the element is on the far right side.
2 Right click the Cart1 SmartElement in the basement and select Attributes. In the Attributes Sheet, set the attributes as shown in the table. Attribute Description Content Sets the content of the element to Select Static Content. the Shopping Cart Data-Map Click the ellipsis button, and Content Table. choose Shopping Cart Data-Map. Show all columns. Cookie Expiration Stores the shopping cart data in (days) a cookie file on the client for the designated amount of time in days.
To create an Element Collection for the ShoppingCart Object: 26 Chapter 1 1 Right click the ShoppingCartObject element in the basement and choose Add to SmartElement Library. Name the element BookstoreCart and click OK. 2 From the Element Toolbar open the Element Library by clicking the Element Library button. Click the Element Collections tab and check the box next to the BookstoreCart name. Doing this will add the element to the Element Toolbar.
3 Choose an icon to use to represent the collection on the SmartElements toolbar. Uncheck the Use Wizard checkbox, if it is not already unchecked. Click the Edit button and then click the Appearance tab. Click Change Icon. Scroll to the far right for the next to last icon and you’ll find the icon created especially for this element, as shown in the margin. Click OK, OK again, and then Done.
To add a Shopping Cart button: 1 Drag an Image Button from the SmartElements Toolbar to the upper right side of the layout (under the ‘Number of Copies’ text). 2 In the Attributes tab, name the button ShoppingCartButton. 3 From Asset Center query for images. Locate and drag the btn-AddToCart2 and btn-AddToCart1 images to the Image Button element. 4 Right click the Image Button element and choose Possible Activations.
6 Shift select the following elements: Add to Shopping Cart button (on page) Dropdown list for number of copies (on page) ShoppingCartObject (in Basement) BookQuery Recordset (in Basement) Right click and choose Possible Interactions.
7 Parameter Description Set to: Redirect after adding Redirect the shopper to confirmation page. Checked Redirect if already in Cart: Redirect the shopper to a message Checked page if the selected item is already in the cart.
Build the Shopping Cart Page The Shopping Cart page displays the items in the Shopping Cart and allows the shopper to manage his or her cart. From this page the shopper can check out or continue shopping. To develop the Shopping Cart page: 1 In Site Manager, click the Shopping Cart page to make its layout active. 2 From the SmartElements Toolbar, add the ShoppingCartObject Element Collection named BookstoreCart to the Basement of the page. This is the Element Collection created previously.
Note: The Attributes Sheet for this element is very long. In order to see and set all the attributes, use the attribute scroll buttons (the blue arrows) in the top right corner of the Attributes Sheet.
Attribute: Set to: ShowSummary Checked UseCurrencySymbol Checked EmptyMsgStyle SC Display Header EvenRowStyle SC Text HeaderStyle SC Display Header OddRowStyle SC Odd Row SummaryStyle SC Totals Name ShoppingCartDisplay Adjusted Total Label Adjusted Subtotal ColumnWidths 10%,45%,15%,15%,5% CurrencySymbol $ EmptyMsg Shopping Cart is Currently Empty GrandTotal Label Grand Total SourceCart ShoppingCartObject Subtotal Label Subtotal Align left HeaderAlign left HeaderVAlign to
To create an Element Collection for the ShoppingCartDisplay Object: 34 Chapter 1 1 In the Layout, shift-select the ShoppingCartDisplay and ShoppingCartObject elements. Right click and choose Add to SmartElement Library. Name the element BookstoreCartandDisplay. Click OK. 2 In Element Library, click the Element Collections tab and check the box next to the BookstoreCartandDisplay name. You can change the icon from Edit > Appearance as you did with the ShoppingCart object.
Managing the Cart Additional functions required by shoppers are the ability to modify quantities, remove individual items, or clear the cart completely and continue shopping. Continuing on the same Shopping Cart page, you will add update, checkout, clear cart, and continue shopping buttons to the Shopping Cart page. Add an Update Button To add an update button: 1 Drag a Form Button from the SmartElements Toolbar to the layout above the ShoppingCartDisplay element.
3 Shift select the following elements: Update Button (on page) ShoppingCartObject (in Basement) 4 Right click and choose Possible Interactions. Scroll to the eStore Shopping Cart category and double click the interaction: Do not display Update if ShoppingCartObject is empty There are no parameters for this Interaction. 5 Shift select the following elements: Update Button (on page) ShoppingCartDisplay (on page) ShoppingCartObject (in Basement) 6 Right click and choose Possible Interactions.
Add a Checkout Button To add a checkout button: 1 From the SmartElements Toolbar, add another Form Button to the layout, next to the Update Order button. 2 Right click the button and choose Attributes. In the Attributes Sheet, set the attributes according to the following table and as shown in the accompanying figure. Attribute Description Set to: Left Positions button 165 Top Positions button 202 Anchor Sets element as page anchor when enabled.
4 Right click and choose Possible Interactions. Scroll to the eStore Shopping Cart category and double click the interaction: Do not display Checkout if ShoppingCartObject is empty There are no parameters for this Interaction. This next Interaction ensures that edits are made to this page and saved in the Shopping Cart array and carried over to checkout. 5 38 Chapter 1 With the CheckOut button and the ShoppingCartObject still selected, shift select the ShoppingCartDisplay element in the layout.
6 Right click and choose Possible Interactions. In the eStore Shopping Cart category, double click the interaction: Update ShoppingCartObject with data from ShoppingCartDisplay when Checkout is clicked and redirect to pagename. 7 In the Parameters dialog, click Assign. Then, expand the Search For Books node and select the CheckArea page. This is the page to which the visitor is redirected after updating.
Clear Items from the Cart To clear all items from cart: 1 From the SmartElements Toolbar, add another Form Button to the layout next to the Checkout button. 2 Right click the button and choose Attributes. In the Attributes Sheet, set the attributes according to the following table and as shown in the accompanying figure. Attribute Description Set to: Left Positions button 275 Top Positions button 202 Anchor Sets element as page anchor when enabled.
4 Right click and choose Possible Interactions. Scroll to the eStore Shopping Cart category double click the interaction: Do not display ClearCart if ShoppingCartObject is empty There are no parameters for this Interaction. 5 With the ClearCart button and ShoppingCartObject elements still selected scroll to the eStore Shopping Cart category and double the interaction: Remove all ShoppingCart items when ClearCart is clicked and redirect to page 6 In the Parameters dialog, click Assign.
Add a Continue Shopping Button To add a Continue Shopping button: 1 From SmartElements Toolbar, add another Form Button to the layout next to the Clear Cart button. 2 Right click the button and choose Attributes. In the Attributes Sheet, set the attributes according to the following table and as shown in the accompanying figure. Attribute Description Set to: Left Positions button 390 Top Positions button 202 Anchor Sets element as page anchor when enabled.
4 Right click and choose Possible Interactions. In the eStore Shopping Cart category and double click the interaction:: Update ShoppingCartObject with data from ShoppingCartDisplay when Continue is clicked and redirect to pagename 5 In the Parameters dialog, click Assign. Then, expand the Search For Books node and select the Book Search Result List page. This is the page to which the visitor is redirected when clicking the continue shopping button.
Publish and Browse You can now publish the site and search for books and click through to the products detail page. You can add and view books in the Shopping Cart. To publish the site: 44 Chapter 1 1 In Windows Explorer, create a new folder under the inetpub\wwwroot\ directory. Name the new folder QuickStore. 2 The Staging Publishing settings have already been set up in Drumbeat to point to the QuickStore folder. To view the settings go to the main menu and choose Publish > Staging.
3 Click the Publish button on the main toolbar and choose All Pages. Publishing takes several moments. Once the publishing has been completed, you need to copy the book cover images into the images folder under the publish folder. (The images folder was created during the publishing process). The book cover images are referenced in the Books table as a relative path to \images\filename.
Take a Snapshot Site Snapshot enables you to save a copy of the project file in its current state under a different name. Drumbeat saves every change you make to the application to the project file as you work, so taking a Snapshot becomes important when you want to save milestones as backups. Once you have taken a Snapshot you can continue to work on the site or switch back to the Snapshot. To take a Snapshot: 1 From the main menu, choose File > Snapshot.
Step 2: Setting Up Login and Checkout The basic checkout area includes pages where the site shopper can change the contents in the shopping cart, and decide to check out. The first stage of checking out is the login page. Returning shoppers are sent to the checkout page. The checkout page displays the shopping cart’s contents and their personal account information. The returning shopper can decide to change the personal information from this page.
Validate the username and password boxes You will apply a validation that ensures that shoppers enter text into the edit boxes. The Non-blank validation can be applied at any time before the form is submitted. You will add it first since it deals with only one element and is the simplest procedure on this page. To validate the edit boxes: 1 On the CheckOutLogIn page, select the UserName edit box. Right click and choose Possible Activations.
8 Select the Form element in the Basement. Right click and choose Possible Activations. 9 Scroll to the Forms Validation category and double click the activation that says: Login Form: Validate when LoginForm is submitted. There are no parameters. This ensures that all validation activations have been applied prior to submission. If any fail, an error report is generated, displayed to the user, and the form is not submitted.
6 The Interaction Center now shows the Possible Interactions between the edit box and cookie elements currently selected. Double click this interaction: Set Content of UserName to the value in Password Cookie 7 Set the Name parameter to eStoreUserName, then click OK. Parameter Description Set to: Name Defines the Name in the NameValue pair which is stored in the cookie.
To save the passwords in a cookie: 1 To ensure the necessary elements are selected, first select the Password edit box. Then, shift-select the PasswordCookie element in the basement. 2 Right click and choose Possible Interactions. 3 View the Cookie category and double click this Interaction: Set content of Password to the value in PasswordCookie 4 Set the Name parameter to eStorePassword, then click OK.
10 Set the Name parameter to eStore Password, then click OK. Parameter Description Set to: Name Defines the Name in the NameValue pair which is stored in the cookie. Paste (Ctrl+V) eStorePassword 11 Select the SavePassword checkbox. Then shift select the PasswordCookie. 12 Interaction Center now shows the Possible Interactions for the check box and cookie elements currently selected.
3 Scroll to the bottom of the Security category and double click this Interaction: Verify username from Username and password from Password and redirect (store additional request in Session) 4 Set the parameters according to the following table, then click OK. Parameter Description Set to: SuccessRedirect Defines the page to redirect to when the username and password matches a record in the recordset Click the Assign button. Click the tree node. Select the Check Out page (under the CheckoutArea).
Create and Update User Profiles The NewUser and UpdateUser pages insert user data into the Customers Recordset. The functionality has already been added to the Quick Store Starting Point so you can focus on setting up the main e-commerce functionality. After completing this tutorial, refer to Chapter 3 Creating Checkout Pages in the Building Your eStore section of this book for page descriptions.
ShippingHidden (hidden form element) The Interactions you will add on the page: You will apply Point-and-Click Interactions for ordering and payment functionalities including shipping, and tax calculation on-the-fly. eStore shipping eStore tax eStore Shopping Cart Database Edit Forms Set Value Form Submit Check the Customer Database We have added a filter on the Customers recordset to this page in the Starting Point.
View Shopping Cart Contents The Shopping Cart Display element is used to display the contents of the shopping cart. 1 From the Element Toolbar, use the Shopping Cart and Display Element Collection, named BookStoreCartandDisplay, you previously created, and drop it on the layout. 2 Select the Shopping Cart Display element, right click and choose Attributes. Position the display at Left 24 and Top 438. Next, add an update cart button: 1 From Element Toolbar, add a Form Button.
Displaying the OrderDate The order date is set to the current date of the server following these steps. Set tokens in the Order Date text box: 1 Right-click the OrderDateText text box element and select Attributes. 2 From the drop down list for Content, select Text. 3 Click on the ellipses button to open the text editor. 4 Enter [monthnumber]/[daynumber]/[year] for the tokens. Then, click OK. 5 Right click the OrderDateText text box and choose Possible Activations.
Inserting OrderDate into the Orders Recordset Set the token in the hidden form element: 1 Right-click the OrderDateHidden element, in the Basement, and select Attributes. 2 From the drop down list for Content, select Text. 3 Click on the ellipses button to open the text editor. 4 Enter [monthnumber]/[daynumber]/[year] for the tokens. Click OK. 5 Right click and choose Possible Activations.
Calculating the Subtotal These values are calculated using interactions between text boxes and the ShoppingCartObject. The steps for each one are the same, only the participants are different. To calculate the Subtotal: 1 Select the SubtotalText text box. Type $[SUBTOTAL] in it 2 Shift select the following elements: SubtotalText text box (on page) ShoppingCartObject (in Basement) 3 Right click and choose Possible Interactions.
Calculating and Displaying Shipping Cost There are numerous methods for calculating shipping costs in eStore Builder. For this tutorial, we will use the simplest method and calculate shipping cost based on a flat rate of $5 per item. Other options include shipping costs based on weight and on total purchase. There is also a UPS server-side interaction with eStore that provides shipping options and corresponding costs. Please refer to the DrumNotes for more details on these alternative shipping methods.
Inserting Shipping Cost into the Orders Recordset Now we set up the Shipping Cost to be inserted into the Orders recordset when the Submit Order button is clicked. Since this is not possible using a text element, we need to insert it from the ShippingHidden hidden form SmartElement. Set the token in the hidden form element: 1 Right-click the ShippingHidden element, in the basement, and select Attributes. 2 From the drop down list for Content, select Text.
8 Right click and choose Possible Interactions. In the Database Edit category, double click the interaction: Use ShippingHidden data to update/insert in Orders when SubmitOrder is clicked 9 Set the Recordset parameter according to the following table, then click OK. Parameter Set to: Recordset Column Freight Calculating and Displaying Sales Tax To calculate Sales Tax: 1 Select the SalesTaxText element and enter $[SalesTax].
Inserting Sales Tax into the Orders recordset Now we need to set up the sales tax to be inserted into the Orders recordset when the Submit Order button is clicked. Set the token in the hidden form element: 1 Right-click the SalesTaxHidden element, in the basement, and select Attributes. 2 From the drop down list for Content, select Text. 3 Click on the ellipses button to open the text editor, and enter [SalesTax].
5 Right click and choose Possible Interactions. In the Database Edit category, double click the interaction:: Use SalesTaxHidden data to update/insert in Orders when SubmitOrder is clicked 6 Set the Recordset Column parameter according to the following table, then click OK. Parameter Set to: Recordset Column SalesTax Calculating the Grand Total This value is calculated the same way as the Subtotal, only the participants and the token are different.
Inserting CustomerID into the Orders Recordset The CustomerID is derived from the Customers recordset, and inserted into the Orders recordset. Bind the CustomerIDHidden element to the Customers recordset: 1 Right-click the CustomerIDHidden element, in the Basement, and select Attributes. 2 From the drop down list for Content, select Recordset. 3 Select the Customers recordset, and the CustomerID column. 4 Leave the check boxes unchecked.
To insert the new order and save the OrderID in the Session element: 1 Shift select the following elements: Session (in Basement) Orders recordset (in Basement) Submit Order button (on page) 2 Right click and choose Possible Interactions. Scroll to the eStore Shopping Cart category and double click the interaction: Insert order in Orders and store OrderID in Session when SubmitOrder is clicked 3 66 Chapter 1 Set the parameters according to the following table, then click OK.
Insert the Shopping Cart as Order Details After you insert the order, and OrderID in the session object, you use the OrderID, along with the Shopping Cart contents to insert into the OrdersDetail recordset. 1 Shift select the following elements: ShoppingCartObject (in Basement) Session (in Basement) OrderDetails recordset (in Basement) Submit Order button (on page) 2 Right click and choose Possible Interactions.
Submit the Form Next, you will apply the Activation that submits the form when the shopper clicks the Submit Order button. 1 Right click the Submit Order element and choose Possible Activations. 2 Scroll to the Forms Submit category and double click this activation: SubmitOrder: Submit the form when SubmitOrder is click 3 Set the parameters according to the following table, then click OK.
Publish and Browse Click the Publish button on the main toolbar and choose All Pages. Publishing takes a few moments. When Publishing has been completed, click Browse on the main toolbar. Take a Snapshot Site Snapshot enables you to save a copy of the project file in its current state under a different name. Drumbeat saves every change you make to the application to the project file as you work, so taking a Snapshot becomes important when you want to save milestones as backups.
Step 3: Confirming the Order When the shopper clicks the Submit Order button on the Checkout page, two actions can take place depending on the outcome of the payment and order insert mechanisms. If the order is submitted properly, the shopper is taken to a confirmation page, which assures the shopper that he or she will soon receive the order. If the order is not submitted properly, the shopper is taken to the Order Failed page, which provides a phone number for phone orders.
Use OrderID in Session to Filter Recordsets You will reference the recordset with the session variable before the Order Confirmation page loads ensuring that the current order is displayed. To do this: 1 Click the Order Confirmation page to activate its layout. 2 From Asset Center, click the Locate Assets button. Select SmartElements > Show all SmartElements using custom technology. 3 Click the word custom (underlined in blue) and select asp from the list. Drag the ASP Session object to the page.
To filter the customers recordset with the customerID: 1 Shift select the following elements: Customers recordset (in Basement) CustOrderDetails recordset (in Basement) 2 Right click and choose Possible Interactions. Scroll to the Database Filter category and double-click the interaction: Filter Customers with related field from CustOrderDetails 3 Set the parameters according to the following table, then click OK.
Display Order Data on Order Confirmation Page This is done by replacing tokens. Tokens for billing and order information are used on the Confirmation Page. To replace tokens for First and Last Name in Order Summary area: 1 Shift select the following elements: Ordering text element (on page) Customers recordset (in Basement) 2 Right click and choose Possible Interactions.
To replace tokens for Total Price: 1 Shift-select the following elements: TotalPrice text element (on page) OrderTotals recordset (in Basement) 2 Right click and choose Possible Interactions. Scroll to the Database Miscellaneous category and double click the interaction: Replace [token] in TotalPrice with value of [Field] from OrderTotals Set the parameters according to the following table, then click OK. Parameter Description Set to: Token Defines tokens in commadelimited string.
To replace tokens for Shipping Address data: 1 Shift-select the following elements: City text element (on page) Customers recordset (in Basement) 2 Right click and choose Possible Interactions. Scroll to the Database Miscellaneous category and double click the interaction: Replace multiple [tokens] in City with values from Customers 3 Set the parameters according to the following table, then click OK. Parameter Description Set to: Token List Defines tokens in commadelimited string.
Moving Forward Quick Store is a fast-track approach to understanding e-commerce application development. Hopefully, by going through Quick Store, you have acquired an awareness of which SmartElements and Interactions can be used when developing an e-commerce application in Drumbeat. As well as getting acquainted with eStore, you have built a fully functioning store front.
Shopping Cart Data-Map The Data-Map is a static Content Table in Drumbeat. You can change and customize it as you would any other static Content Table (see index of the Drumbeat User’s Guide or HTML Help for information about Content Tables). Depending on your specific storefront requirements, your Data Map will look different from project to project.
Shopping Cart Display (Page-level) SmartElement This is a place-holder display image that represents the look and content of the server-side element. Since the actual content of the server-side Shopping Cart cannot be displayed at design-time, use the Shopping Cart Display page-level element while developing the storefront in Drumbeat.
2 CHAPTER 2 Setting Up Product Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The content on the product pages comes from the products database. To display product information you first need to query the products database and display the query results in an ODBC Content Table in Drumbeat. Then, you can use the DataForm Wizard to create the product pages.
Setting Site Preferences Set the Drumbeat Site Preferences to ASP. From the main menu, choose File > Preferences > Site. Select ASP for the Server application support. Setting Publishing Settings Enter your publish settings. From the main menu, choose Publish > Publish Settings. In the General tab, enter the publishing path and the local ASP server name (if you are publishing to other than your local machine). Then, in the ASP tab, enter the Alias.
Setting up a Data Source Name to the Products Database Set up a System Data Source Name (DSN) to the products database. The DSN is set up in the Windows ODBC Administrator that can be accessed from Query Manager in Drumbeat or from the Windows Control Panel. If you need step-by-step instruction on how to set up a DSN, check the index of the Drumbeat User’s Guide or Help for the words in bold.
Creating a Query Create a query. From Asset Center, click Add Assets and choose Queries. Then click New. The SQL Query dialog opens where you can use SQL Wizard to create the query. The query results are used to generate the product pages. Click Save Query. The Query Manager opens, click Create Table. Doing this creates an ODBC Content Table. You can view the content table in Content Center. Choose the query name from the Content Table list.
Creating Product Pages with DataForm Wizard This is a simple example in which two product pages are generated using DataForm Wizard. The first product page lists the product items in a table. The product name is linked to a product details page. After creating product pages, you can add the shopping components. Chapter 3: Adding Products to the Shopping Cart contains an example of adding the shopping components.
Chapter 2 2 In the first screen, select the ODBC Content Table that represents the product information. 3 DataForm Wizard asks you to enter a name for your DataForm and choose the pages you want to create. A Detail page will always be created, so this option is checked by default and grayed out. For this example, only the Results List and default Detail page will be created.
4 In the Message option dialog, you can choose the message you want to display when users reach the end of record navigation while browsing Detail pages, or accept the defaults (No more records). 5 In the next screen, you choose the columns in the Content Table that you want to display in the Detail page by checking those fields you want to include. 6 Navigation buttons can be used to browse through detail pages.
Chapter 2 7 In this example the Result List page is used to provide an abbreviated list of all product items by default (when the page is accessed directly, instead of via a search). 8 In the next screen, you can choose to have sort features on the Results List page. You can also choose how many records you want to show on the page.
9 The page that lists all the product items has a link to a page where the product item is described. Choose which column you want to link to the details page. If the unique key has not been set in the Query, you will have to indicate the unique keys in the database in one more dialog. To generate the pages, click Finish.
After clicking Finish, DataForm Wizard generates the products results and details pages. Each DataForm page contains the Recordset SmartElement in the Basement that represents the data source for that page (as shown in the Results List page in the screenshot below). A Recordset element is created for each database query that is used on a page. You can see another element displayed in the Basement that represents the Form on the page.
The shopping cart will be added to the product detail page in Chapter 3: Adding Products to the Shopping Cart. If you need step-by-step instruction on how to publish and browse product pages, check the index of the Drumbeat User’s Guide or Help for the words in bold.
Chapter 2
3 CHAPTER 3 Adding and Updating the Shopping Cart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Before adding the shopping cart to the page, you need to import the Data-Map Content Table into Drumbeat that works with the Shopping Cart elements. The Data-Map tells the shopping cart which database columns (fields) to get data from and which to update. It also tells the Shopping Cart display SmartElement what to display on the page.
Updating the shopping cart can take place on the page where the shopper adds items to the shopping cart, or a redirection page. On either page, the shopper can manage the shopping cart by increasing the quantity of an item or removing it from the shopping cart altogether.
Customizing the Data-Map Each project is unique. Therefore, you will probably want to customize the DataMap at some point to suit your own requirements. Customizing the Data-Map gives you a lot of flexibility regarding the database tables you need to reference and the type of functionality you want to set up.
Chapter 3 4 In the Data-Map table in Drumbeat, double click the first cell under the column header titled ProductID. The text editor appears. Look at your products (source) database table in your database program to find the Unique Key field-name. Then, enter the field name of the Unique Key in the cell. 5 The second column titled Qty, which stands for Quantity, has None entered by default and should not be changed.
6 Double click the Price cell and enter the field name for the product-item price field. 7 The next two cells in the basic Data-Map table: Total and Remove should not be changed. The word None is entered indicating that the content does not come from the source database. Instead this content comes from the site shopper’s activity. The first row should reflect the field names of your source database. Double check to make sure that you haven’t made any typos and that you entered the correct field names.
Chapter 3 4 In the Data-Map table in Drumbeat, double click the second cell under the column header titled ProductID. The text editor appears. Look at your orders-details (destination) database table in your database program to find the Unique Key field-name. Then, enter the field name of the Unique Key in the cell. 5 Double click the second cell under the column header titled Qty (stands for Quantity). The text editor appears.
The second row should reflect the field names of your destination database. Double check to make sure that you haven’t made any typos and that you entered the correct field names. Note: Data-Map Third Row: Do not change this row. Provides keys for required columns of the shopping cart. This allows the shopping cart code to track required columns without having to know the column title or the relative column position.
Adding Columns to the Data-Map By adding columns to the Data-Map you can: Add additional columns in the Shopping Cart Display Capture additional columns into the Orders (destination database) tables. To add a column to the Data-Map content table: 98 Chapter 3 1 In Content Center, open the Data-Map. 2 Click the Add Row/Column and choose Add Row from the list. 3 In the Column dialog, enter a name. The name you enter will appear in the Shopping Cart Display element on the page.
8 In the Content dialog, make sure all the columns are under ‘Show these columns’. Note: A typical cause of the ‘SourceCol is undefined’ run-time error is caused by Data-Map columns configured as ‘not shown’ for the content attribute of the Shopping Cart. Displaying the Shopping Cart Data-Map Columns Data-Map Fourth Row (Is Visible): Determines the visibility of a column in the Shopping Cart Display element.
Adding the Shopping Cart SmartElement To insert product items into a shopping cart, you need the Shopping Cart server, Recordset, and Form button SmartElements on the same page. In the example below, the Shopping Cart element is added to the Product Detail page generated by DataForm Wizard (see Chapter 2 Creating Products Pages). An Interaction is added to three elements so that the current product item in the recordset is added to the shopping cart when the button is clicked.
To create an Element Collection: 1 In the Basement, right click the ShoppingCartObject element and choose Add to SmartElement Library. Name the element and click OK. 2 From the Element Toolbar open the Element Library by clicking the Element Library button. Click the Element Collections tab and check the box next to the name. Doing this will add the element collection to the Element Toolbar. You can also change the default icon. 3 Uncheck the Use Wizard checkbox, if not already.
Adding an Add-to-Cart Button on the Shopping Page You can use either a Form Button or an Image Button on a product detail page that when submitted adds the product information to a Shopping Cart. The button must have a Submit Form action. The Form Button has the Submit Form action by default. If you are using an Image Button element, you must apply an Activation manually to submit the form when it is clicked. You must also add a Hidden Form element so the Document object includes a Form object.
Parameters: Redirect after adding: A toggle that determines whether you want to redirect after adding the item or not. NewItemRedirect: Specifies the target page for redirecting after an item is successfully added to the cart. Redirect if already in Cart: Toggles whether you want to redirect to a message page if the selected item is already in the cart.
To add the Shopping Cart server SmartElement from Asset Center: 1 From Asset Center, click Locate Assets and choose SmartElements > Show all Custom SmartElements, mouse down to the Shopping Cart SmartElement. 2 Drag and drop the element on the page. The element shows up in the Basement. This element represents the Shopping Cart on the server. 3 With the element selected, activate the Attributes Sheet.
Formatting the Shopping Cart Display SmartElement The Shopping Cart Display element can be displayed on the page in many ways. It has formatting attributes that you can change. Along with the attributes, you can customize the Data-Map and decide on such things as how many columns to display and the name of the column headers. Here’s a screenshot of how the basic Shopping Cart Display looks on a published page.
Displaying Column Headers in the Shopping Cart Display Most likely, you will want to change the default column header names. These header names are coming from the column headers in the Data-Map. To change these names you need to open the Data-Map Content Table and change the column header name to the desired name. To change the column header name: 1 In Content Center, open the Data-Map Content Table. 2 Double click the column header and set the name in the Column dialog.
Changing the Design-time Shopping Cart Image Once you have formatted the Shopping Cart display by setting its attributes, you can publish, browse, and then take a screenshot of the display. Save the screenshot as a BMP. Then, you can change the design-time image. From Element Library in the Appearance tab, you can browse to and select the BMP for the element to use at design-time.
Inserting Quantities of Items To allow shoppers to edit the quantity for each item, you need to display the quantity column in the Shopping Cart Display page element. To allow shoppers to edit quantities: 1 In Content Center, open the Data-Map Content Table. 2 In the cell for the IsVisible row under the Qty column, set the value to 'True'. Now the Quantity column in the Shopping Cart page element will be visible.
Testing and Trouble Shooting the Shopping Cart Once you have added and configured the shopping pages, you are ready to test the shopping cart connection to the products (source) and orders (destination) database tables. To test the shopping area, you must publish the site to an ASPcompatible server. To help you test and trouble shoot, here is table with the most common run-time errors and their solutions.
Chapter 3
4 CHAPTER 4 Creating Checkout Pages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Following the typical flow of an e-commerce site, the first stage of checking out is the login page. After logging in, all returning shoppers are directly sent to the checkout page where their account information is automatically displayed. The checkout page lists the shopping cart’s contents and the account information.
Creating Login Pages Login saves shoppers a lot of time from repeatedly entering account information when buying products. The username and password are compared against a customers database. If registered, the shopper is taken to the final checkout page listing account information and the shopping cart’s contents. The main functionality on a login page is set using the Security and Database Navigation Interactions. Cookie Interactions can be used to customize the page to the site visitor.
The first interaction compares the username and password to the Customers recordset. The security interaction is between the username and password edit boxes, the login button page elements, and the form and recordset Basement elements. In the parameters dialog, you can set up the failed and successful redirection pages. As well, you can choose an access group (learn about access groups in DrumNote 3) and additional variable to store in a Session object.
The second interaction maintains the state of the recordset when redirecting. It is between the login (form) button and the Customers recordset. Now, click an empty space on the layout to view the full list of interactions on the page. You can see that a number of Cookie Interactions. These interactions are applied to capture in a cookie the username and password. This functionality makes the site easier to use by saving the login name and password if the site visitor decides to do so.
Creating New and Update User Pages Both the new and update user pages insert and update user data into a Customers recordset. To use as an example open the QuickStoreComplete Starting Point (is not already) and activate the NewUser page in the layout. The NewUser page in the QuickStoreComplete EDF file was initially built using DataForm Wizard and then enhanced with elements and interactions. In DataForm Wizard, select an Insert DataForm. A Detail DataForm page is created by default.
You can see that the enhanced NewUser page has an added recordset on the page. The recordset holds Credit Card types. This was added so that a dropdown list could be populated with the credit card types. Database Edit Interactions were applied to the credit card fields so the credit card selection would be inserted into the Customers database table. The interaction is between an edit box, the insert button, and the Customers recordset. Notice the Database Navigation activation on the Insert button.
Notice on the page under the Shipping Information header, the checkout box that when checked enters the billing address in the shipping address fields. This is a very common and convenient feature. An Interaction under Forms Interelement category is used between a billing address, shipping address, and checkbox. The other interactions on the page are mainly for validation. You can look at each validation interaction in the QuickStoreComplete file.
Creating the Check Out Page At browse time the shopper logs in as an existing customer or registers as a new one on the New User page. Before the Checkout page loads the Customers recordset is filtered on the CustomerID in the session variable. Step 2 Logging in and Checking out in the Quick Store tutorial shows you how to save the CustomerID and filter the Customers recordset.
Notice that some of the text fields have tokens and some do not. Select one of the text elements that do not have tokens and click the Attributes tab. You see that the Contents attribute is set to the Customers recordset. Now, select one of the text elements that have tokens. Click the Attributes tab and look at the Content attribute. Notice the Content attribute is set to Text. Setting the Content attribute to text and adding tokens allows you to to display static and dynamic content in a single text box.
To create a token: 1 Select the text element and type the desired text adding a token in brackets [ ]. 2 Select the recordset in the Basement and text element on the page. Right click and choose Possible Interactions. 3 Replace multiple [tokens] in [TextElement] with values from [Recordset] 4 In the parameters dialog, type in the desired tokens. The tokens will be replaced before the page loads.
5 CHAPTER 5 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . You can ensure secure transactions using the following methods: Encryption: Save the check-out pages on a secure server using Secure Socket Layer (SSL). Database: Make sure the database is not saved in the wwwroot directory on the server. Add a user name and password to the database.
Linking Using HTTPS Protocol If you want to assign links using HTTPS protocol, you will need to set up a web server certificate. There are a number of vendors that provide digital certificates. The most popular vendors are: VeriSign: www.verisign.com Thawte: www.thawte.com You can go to their sites and apply for a digital certificate. If you are deploying the site at an ISP, you should make sure they have a secure server. Then, you need to set up the link in Drumbeat using HTTPS.
Authentication and Log In Shoppers can bypass entering their account information multiple times by entering their user name and password. Conveniently, product items can be ordered in just a few clicks. As a developer, you can make sure account information is private and secure. To add privacy and security while logging in: On NT servers, use the Management Console to set up the Challenge Response.
Chapter 5
6 CHAPTER 6 Payment Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Payment processing falls under two umbrellas: offline and online transactions. You can determine which one is best for you by answering the following two questions.
Recommended Reading Navigating E-Commerce (Copyright of MonkeySoup.com by Greg Zellers) Install Path: /Drumbeat/eStore Builder/navigating.doc Understanding Electronic Commerce, David Kosiur Microsoft Press. Online Transactions with CyberCash For online transactions, CyberCash provides credit card services that includes authorization, capture, voids, returns, etc. Currently, the Drumbeat CyberCash SmartElement provides the capability to authorize and capture credit card charges.
Setting up CyberCash Test Account You can install a test account on your publishing server. 1 From Windows Explorer, navigate to /Drumbeat 2000/ eStore Builder/Install. 2 In the Install folder click on the Setup.exe file. The Merchant Connection Kit Setup is launched. Click Next. 3 In the second screen, make sure the Build a Test Merchant radio button is selected and click Next. 4 In the next screen, you are asked to navigate to a destination directory.
Adding the CyberCash SmartElement This example demonstrates how to add the CyberCash SmartElement and apply interactions to authorize and capture order and payment information. 1 From Element Toolbar, add the CyberCash SmartElement to the layout. The element shows up in the Basement. 2 Right click the CyberCash server object and select Attributes. In the Attributes Sheet.
Passing the OrderID to the CyberCash Object To pass the orderID to the CyberCash element you need to have the Orders recordset, a Session element, and a Form button on the page. Open DrumNote 502 to view an example of this. These instructions show the interaction and its participants.
Setting Customer Credit Card Properties This is an interaction that sets all the CyberCash SmartElement credit card properties to values from the Customer recordset. The Interaction parameters specify the columns in the recordset that contain data appropriate for the respective credit card properties.
CyberCash Attribute Description: Parameter Set to: BillingCountryCol BillingCountry BillingZipCol BillingPostalCode BillingStateCol BillingRegion BillingCityCol BillingCity BillingAddressCol BillingAddress Exp Year Col CardExpYr Exp Month Col CardExpMo Card Number Col CreditCard CardHolder First Name Col FirstName CardHolder Last Name Col LastName Submitting to CyberCash This interaction is between the CyberCash element and a Form button.
Storing the Transaction Results in Session Object This Interaction allows you to store transaction status data returned from CyberCash in the Session object. The status can be displayed in the error message on a “failure” page (as seen in DrumNote 502). This interaction must be applied after the Submit contract.
Storing the Transaction Results in the Orders Recordset This interaction allows you to store the transaction results in the Orders recordset and redirect based on the transaction outcome (as seen in DrumNote 502). To store the outcome of the transaction: 1 Shift select the following elements: Recordset (in Basement) Submit Order button (on page) CyberCash element (in Basement) 2 Right click and choose Possible Interactions.
Setting Up Offline Transactions To learn how to capture an order in an orders table, refer to Step 2 Logging In and Checking Out in the Quick Store tutorial under the Insert the Shopping Cart as Order Details section. Once the order has been captured in the database you can send it to the payment processor at any time. For detailed information on how to set the payment process up, see the document titled Navigating an E-commerce site located in /Drumbeat/eStore/Documents/Navigating.
7 CHAPTER 7 Merchandising . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Merchandising adjustments can be set up on a product item (sometimes referred to as line-item) or order sub-total (i.e., price without shipping and tax costs). The adjustment can either be a discount or a fee. To calculate the discount or fee, you can add or deduct a flat-rate or percentage.
Store merchandising adjustments: Percentage adjustments (discounts or fee) on total weight, quantity and purchase price. Percentage adjustments (discount) on total number of product items purchased. Flat-rate adjustments (discount or fee) on total weight, quantity and purchase price. Flat-rate adjustment (discount or fee) on total number of product items purchased. Note that the type of merchandising features determines the Data-Map to use in your site: BasicShoppingCart.
Setting Up Adjustments for Total Weight, Quantity or Purchase You can add sub-total adjustments to the page by applying activations on the Shopping Cart. When you apply activations on the Shopping Cart SmartElement, you can set up the adjustment on such order attributes as, weight, quantity, or sub-total. 1 In Drumbeat, open the shopping page. This page has the Shopping Cart SmartElement in the Basement and the Shopping Cart Display SmartElement on the page.
Chapter 7 2 In the Basement, right click the Shopping Cart SmartElement and choose Possible Activations. 3 From the possible activations, in the eStore Adjustments category double click: Add [flat-value] adjustment [type] to [ShoppingCart] if [data] exceeds [threshold] 4 In the parameters dialog, set the adjustment parameters. See below for parameter descriptions.
Parameter Description: Parameter Description AdjustmentName Enter a name for the adjustment. AdjustmentType Select the type of adjustment: fee or discount. Comparison Select how you want the order data compared to the threshold: >= and <=. Data Select which shopping cart data to use when comparing against the threshold value: total weight, purchase or quantity. Percentage The percentage value used to calculate the adjustment.
Adjustment Examples Refer to eStore DrumNotes on how to set up a few different types of adjustments within the Drumbeat site file. You can use these site files as building blocks in building your own project. Check the Drumbeat web site for additional DrumNotes that may have been added after this printing. Find DrumNotes on the Drumbeat web site at drumnotes.drumbeat.com. All of the DrumNotes that relate to eStore belong to the 500 series.
DrumNote_500: Handling Fees This DrumNote demonstrates how to automatically add in special handling fees based on shopping cart data. You define a threshold number that must be met before the handling fee is activated. In this example we define a $15 handling fee for orders that exceed 25 pounds. You can also base the calculation on the shopping cart's total purchase or total quantity. \Drumbeat 2000\eStore\xxxx.
Chapter 7
8 CHAPTER 8 Customizing Quick Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . As mentioned at the beginning of this book, the easiest and fastest way to get up and running with eStore is to customize the Starting Point used with the Quick Store tutorial. Below are step-by-step instructions on how to customize the Quick StoreComplete Starting Point with your media and customize the database with your specific product information.
Customizing Templates and Media Assets You can change the background, navigation buttons and link styles on each template so that all the pages under them use your colors and theme. Change the Background Before making modifications, be sure to take a snapshot or open a site based on the QuickStoreComplete Starting Point so you don’t change the base site file. You need to change the background on the two templates and on the Home page.
3 In the Media Properties dialog, click the File Location Browse button and navigate to the background you want to use. 4 If the image does not appear as the background, uncheck and recheck the Background Image checkbox. For information about media assets, see chapter 7 Images in Using Drumbeat.
Change the Navigation Buttons Before making modifications, be sure to take a snapshot or open a site based on the QuickStoreComplete Starting Point so you don’t change the base site file. Each templates has navigation buttons. You can change these buttons to suit your storefront in the attributes for the element. The Image Button SmartElement is used for the navigation buttons so that each button has an on and off state.
Change the Link Styles Before making modifications, be sure to take a snapshot or open a site based on the QuickStoreComplete Starting Point so you don’t change the base site file. You can change the Quick Store link styles to your own on the Master Template. To change link styles: 1 In Templates Manager, click on the Master Template to make its layout active. 2 Click the Attributes tab. For Link Styles (including Visited, Active, and Hover), choose the desired style from the dropdown lists.
Customizing the Quick Store Content The Quick Store content is derived from querying the products database. By changing the content in the products database, adding a new DataSource Name (DSN) and applying that DSN to each query in Drumbeat, you can quickly customize the content in Quick Store. Before making modifications, be sure to make a copy and rename the database. Customize Database Content Before making modifications, be sure to make a copy and rename the database.
2 Open the table in Datasheet view and replace the existing content with your product content. Book cover images are referenced from the books table in the Coverpic field. You can replace the existing images with your own product shots. Remember to copy your product shots to the images folder under the publishing directory. An images folder is created by default when publishing. 3 Once you have finished adding product information to the table, save and close the file.
Chapter 8 6 In SQL Query Manager, select the new DSN from the dropdown list. 7 Click Save Query. 8 In Query Manager, repeat steps 6 and 7 for each query so that each query uses the new DSN. Click Done to close the dialog.
Publish and Browse You can change the publishing setting if you don’t want to override the Quick Store published files. You can learn about publishing Active Server Pages from Chapter 8 Publishing under Publishing Active Server Pages. Once you have published, browse the site with your customized images and content.
Chapter 8
9 CHAPTER 9 Shopping Cart Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Drumbeat Shopping Cart consists of two SmartElements and a set of associated contracts that allow you to capture order information in an on-line shopping session and submit the information to a database. The Shopping Cart SmartElement is a JavaScript object that tracks order information at the session level.
Shopping Cart Attributes The design-time behavior of the Shopping Cart is configured using the Attributes Sheet. Users can configure the following properties: Content: A Static Content table that contains titles of each column in the cart, the associated database source and destination columns, column keys, and column visibility information. Setting up the content table is somewhat complex, and is described in detail later.
Adjustments Array An array of Adjustment objects. Each adjustment object contains several properties that allow the value of the adjustment to be calculated throughout the application. Adjustments are added to the shopping cart using the AddAddjustment method. Values of the adjustment are calculated based on the adjustment object properties using the SetAdjustmentValue method.
Order-level adjustments in the adjustments array are managed via a variety of eStore Adjustments contracts and several methods of the Shopping Cart's API.
AddItem(DbRecordset,qty) Adds an item to the shopping cart, retrieving information from any data in the bindings array (see AddBinding above) and the Recordset based on column names provided in the Shopping Cart's data map. The DbRecordset parameter is a reference to a Drumbeat Recordset. The qty is the number of items to be added. If no quantity is passed, a default value of 1 is used. If the cart is persisted as a cookie, it updates the cookie to reflect the newly added item.
GetAdjustedTotal() Returns the shopping cart's subtotal adjusted for any adjustments in the shopping cart adjustments array. In other words, it is the sum of the value returned by GetSubTotal() and GetAdjustmentsTotal(). GetAdjustmentCount() Returns the number of adjustments with non-zero values currently in the shopping cart's adjustments array.
GetItemCount() Returns the number of line-items currently in the shopping cart. Note that this is not the total quantity of items ordered (see GetTotalQuantity()). Example: If the shopping cart contains a single line in which 5 of ProductX are ordered, GetItemCount() returns 1 and GetTotalQuantity() returns 5. This is useful for testing whether the shopping cart is empty (in which case the method returns 0) before conducting various operations on the shopping cart.
GetTotalWeight() Returns the total weight represented by the current order. This is useful for implementing weight-based shipping, for instance. Note that GetTotalWeight() only works if you track weight in the products database and have included the WEIGHT and TOTALWEIGHT required columns in your shopping cart data map.
SetDiscount(data,type,row) Sets or updates a line-item discount based on the discount threshold and rate stored in the products database. The data argument specifies whether the discount is based on item price or quantity, the type specifies whether the discount is a flat or percentage discount, and row specifies the row to which the discount applies. See DrumNote_506 for general information regarding line-item discount handling by the shopping cart.
Shopping Cart Events Two events are available for the Shopping Cart: Server() The is the 'main event' for the shopping cart. The majority of the current contracts are executed in this event. In some cases, the order in which contracts are applied is important. For instance, it is important that 'Update' contracts are executed before order-level adjustments are applied/updated, so that the adjustments can be determined against an accurate order subtotal.
Configuring Shopping Cart Content: The Data Map For the Shopping Cart to function, you must supply its content in the form of a static content table, affectionately known as the Data Map. This content table provides an information map for the Shopping Cart. You must provide titles for each column of the data map and provide four additional rows. The .csv file in this release provides a starting point for your data map that includes data for all required shopping cart columns.
identifies the name of the database destination field for a given shopping cart column when the cart is submitted to your orders database. Values for this row will depend on your database schema, but you will typically want to store the ProductID, quantity and price. There will likely be several columns that are not submitted to a database destination such as a name, since this could be looked up from the Product ID). For these columns, enter "None".
Line-item discount columns are defined as follows: defines the threshold requirement for receiving the discount. This value will most likely be obtained from your database. Disc_threshold Disc_rate defines the rate of the discount if the threshold is met. determines the value of the discount based on characteristics of the order item and the value in the DISC_RATE column.
Specifying Shopping Cart Column Order You can modify the order in which columns will appear in the Shopping Cart when you first assign the content table to the shopping cart, or by selecting the ellipses button next to the Cart's content attribute after the content has been assigned. A Content dialog appears. In the Show these columns list box (on the right), select an item and use the Move Up and Move Down buttons to rearrange the columns.
Attributes The run-time appearance of the Shopping Cart Display is configured using the Attributes Sheet. Users can configure the following properties: Border specifies the table border width in the Shopping Cart Display. Padding specifies the table cell padding in the display. Spacing specifies the table cell spacing in the display. EditableQuantities toggles whether the quantity column of the display is editable.
specifies font and background color formatting for the Header Row of the table as a Drumbeat style. HeaderStyle Name name of the Shopping Cart Display. a comma-delimited set of percentages to specify the relative column widths of the table. Percentages represent the percentage of the total table width. For instance, with three columns, you could specify 10%, 70%, 20%. If left blank, column widths default to the total table width divided the number of columns.
Shopping Cart Interactions The Shopping Cart Contracts allow you to add items to and update items in a shopping cart, insert shopping cart data into a database, and perform a couple of miscellaneous display functions based on data in the shopping cart. Add item from [Recordset] to [ShoppingCart] when [button] is clicked This is a contract between a basement Shopping Cart SmartElement, a submit button, and a Recordset that provides source data to the Shopping Cart.
Add item from [Recordset] to [ShoppingCart] when [button] is clicked using quantity from [FormElement] This is a contract between a basement Shopping Cart SmartElement, a submit button, a form element and a Recordset that provides source data to the Shopping Cart. When the button is clicked, an item corresponding to the current record in the Recordset is added to the Shopping Cart. With this contract, the quantity for the added item is the value contained in the Form element.
Add item from [Recordset] to [ShoppingCart] when [imagebutton] is clicked (Looper) Use this contract to add items to the shopping cart directly from a looper-based results list without having to navigate to a detail page. It is an interaction between a basement Shopping Cart SmartElement, an image or image button, and a Recordset that provides source data to the Shopping Cart. When the button is clicked, an item corresponding to the current record in the Recordset is added to the Shopping Cart.
Add item from [Recordset] to [ShoppingCart] when [textelement] is clicked (Looper) Use this contract to add items to the shopping cart directly from a looper-based results list without having to navigate to a detail page. It is an interaction between a basement Shopping Cart SmartElement, a text element, and a Recordset that provides source data to the Shopping Cart. When the text element is clicked, an item corresponding to the current record in the Recordset is added to the Shopping Cart.
Add item from [Recordset] to [ShoppingCart] when [imagebutton] is clicked using quantity from [FormElement] (Looper) Use this contract to add items to the shopping cart directly from a looper-based results list without having to navigate to a detail page. It is an interaction between a basement Shopping Cart SmartElement, an image or image button, an edit box or drop down list, and a Recordset that provides source data to the Shopping Cart.
Insert [ShoppingCart] items as new records in [Recordset] when [button] is clicked This contract is an interaction between a basement ShoppingCart element, a submit button, and the destination Recordset for the Cart data. When the button is clicked, the shopping cart data is inserted into the orders database. The "Go To Page" parameter allows you to redirect to the specified page after the insert is completed.
Insert [ShoppingCart] in [Recordset] when [button] is clicked using OrderID from [HiddenFormElement] This contract is an interaction between a basement ShoppingCart element, a submit button, a Hidden Form Element and the destination Recordset for the Cart data. This contract can be used when the order information is submitted on a previous page and redirected to a confirmation page, where the OrderID generated from the previous page is assigned to a form element.
Insert [ShoppingCart] in [Recordset] when [button] is clicked using OrderID from [ASPServer] Similar to its Hidden Form Element counterpart, this contract is an interaction between a basement ShoppingCart element, a submit button, an ASPServer object and the destination Recordset for the Cart data. Note: This contract can be used in conjunction with contracts that generate an OrderID needed for an OrderDetails record (such as the 'Insert order in [recordset]...
Insert order in [Recordset] and store OrderID in [ASPServer] when [button] is clicked This contract inserts a new Order record and allows you to obtain an Autonumber OrderID from the database when a new order is generated from the on-line store. The Autonumber OrderID is placed in an ASPServer object (typically a Session variable). This should be used in conjunction with the InsertCart contracts that insert each cart item as an order detail record using the OrderID value obtained here.
Insert [ShoppingCart] in [Recordset] when [button] is clicked using OrderID from [ASPServer] if [CyberCash] transaction is success This contract is an extension of the interaction to submit the Shopping cart contents to a recordset using an OrderID from the Session. With an additional participant - the CyberCash element - this contract allows you to submit the cart contents if the Cybercash transaction was successful, otherwise the cart won't be submitted.
Insert [ShoppingCart] in [Recordset] when [button] is clicked using OrderID from [HiddenFormElement] if [CyberCash] transaction is success This contract is an extension of the interaction to submit the Shopping cart contents to a recordset using an OrderID from a Hidden Form Element. With an additional participant - the CyberCash element - this contract allows you to submit the cart contents if the Cybercash transaction was successful, otherwise the cart won't be submitted.
Update [ShoppingCart] with data from [SCDisplay] when [button] is clicked This contract is primarily intended for the page containing the shopping cart display element. Within the display element, you can edit quantities and mark items for removal. When the contract is applied the Shopping Cart element, the SC Display and a submit button, the shopping cart is updated to reflect the modifications made in the display element.
Populate [ShoppingCart] with Order from [Recordset] when [button] is clicked This contract retrieves an order record and associated order detail records from the database and populates the shopping cart. The source recordset's query will likely be based on a view that joins the Orders, OrderDetails, Customers and Product tables, so that all the relevant display information for the cart can be retrieved.
Remove all [ShoppingCart] items when [source] is clicked and redirect to page This interaction will remove the session variables that are associated with the shopping cart. It will preserve other session information that you may not want to destroy when the user removes all the items from the cart. Note: Note that it is not necessary when doing an insert of the cart contents in the database. This insert contract has this functionality already built in.
Replace [token] in [target] with item count from [ShoppingCart] This interaction replaces a token in a text element with the item count currently in the shopping cart. the item count, in this case, refers to the number of cart line items as opposed to the total quantity of items in the cart. Parameters: Token is the exact case-sensitive text in the text element that will be replaced with the count of Cart items Participants: Shopping Cart Target (text box, edit box, etc.
Replace [token] in [target] with unique OrderID This is an activation on a text element that replaces a token in a text element with the value of an unique OrderID generated by the server. The OrderID is generated using the SessionID and a timestamp. Parameters: Token is the exact case-sensitive text in the text element that will be replaced with the unique OrderID Participants: Target (edit box, etc.
Add [EditBox] to bindings of [ShoppingCart] when [button] is clicked This contract allows you to add non-recordset data contained in an edit box to the shopping cart when an item is added is added to the cart. This contract must be applied to the Cart before the "Add Item" contract is applied. DrumNote_507 illustrates the use of this and related "'Add to bindings..." contracts. Parameters: Cart Column is the name of the shopping cart column that will hold the data contained in the edit box.
Add value of [ASPServer] variable to bindings of [ShoppingCart] when [button] is clicked This contract allows you to add non-recordset data contained in a Session variable to the shopping cart when an item is added is added to the cart. This contract must be applied to the Cart before the "Add Item" contract is applied. DrumNote_507 illustrates the use of related "'Add to bindings..." contracts. Parameters: VariableName is the name of the Session variable that contains the data to be bound to the cart.
Shopping Cart Miscellaneous Interactions The Drumbeat Shopping Cart Miscellaneous Contracts allow you to enable several miscellaneous eStore features that aren't part of the Core shopping cart functionality. (Allow Mulitples) - Add item from [Recordset] to [ShoppingCart] when [button] is clicked This is a variation of the "Add item from [Recordset] to [ShoppingCart] when [button] is clicked" contract that allows you to add the same product more than once to your shopping cart.
(AllowMultiples) - Add item from [Recordset] to [ShoppingCart] when [button] is clicked using quantity from [FormElement] This is a variation of the "Add item from [Recordset] to [ShoppingCart] when [button] is clicked using quantity from [FormElement]" contract that allows you to add the same product more than once to your shopping cart. This is a contract between a basement Shopping Cart SmartElement, a submit button, a form element and a Recordset that provides source data to the Shopping Cart.
Add item from [Recordset] to [ShoppingCart] when [imagebutton] is clicked (Looper)–Allow Multiples This is a variation of the "Add item from [Recordset] to [ShoppingCart] when [imagebutton] is clicked–(Looper) " contract that allows you to add the same product more than once to your shopping cart. Use this contract to add items to the shopping cart directly from a looper-based results list without having to navigate to a detail page.
Add item from [Recordset] to [ShoppingCart] when [textelement] is clicked (Looper) - Allow Multiples This is a variation of the "Add item from [Recordset] to [ShoppingCart] when [textelement] is clicked - (Looper) " contract that allows you to add the same product more than once to your shopping cart. Use this contract to add items to the shopping cart directly from a looper-based results list without having to navigate to a detail page.
Replace token in [TextElement] with related products from [Recordset], except [ShoppingCart] items and current product from [ProductRecordset] This is a very specialized contract to populate a text element with a list of related products to a given product on a storefront shopping page. It allows you to incorporate the "Customers who bought this product also purchased these products" feature seen in many popular online stores.
Replace [token] in [target] with last [N] characters in credit card number from [Recordset] The interaction allows you to replace a token in a text element the last several digits of a credit card number along with a mask specified as a parameter. This allows you to display a customer's credit card number (at least the last few digits) without displaying the whole number and jeopardizing the security of this important customer information.
Shopping Cart Adjustments The Service release of Drumbeat eStore Builder includes a number of enhancements in the Shopping Cart that enable various merchandising features. These merchandising features are implemented via several new methods and properties of the Shopping Cart API, along with associated contract described in the document. Merchandising features in the Drumbeat Shopping Cart can be broken into two categories: line-item discounts and order-level adjustment (both discount and fees).
Shopping Cart Contracts Add [percentage] adjustment [type] to [ShoppingCart] based on [comparison] of [OrderData] to [threshold] This is an activation on the ShoppingCart that adds a percentage adjustment to the cart based on how the specified order data parameter compares to the threshold parameter. An adjustment in this context represents a fee or discount on the total order.
Add [percentage] adjustment [type] to [ShoppingCart] if [ASPServer] variable matches [value] This is an interaction between the Shopping Cart and a basement Session element that adds a percentage adjustment to the cart if the specified Session variable matches the specified value. An adjustment in this context represents a fee or discount on the total order. One potential use for this interaction is to apply a preferred customer discount on the total order.
Add [percentage] adjustment [type] to [ShoppingCart] when [button] is clicked (requires submit) This is an interaction between the ShoppingCart and a button that adds a percentage adjustment to the cart without any data criterion constraints. An adjustment in this context represents a fee or discount on the total order and is set using the 'AdjustmentType' parameter. Use this contract to provide an 'optional' adjustment based on the user's selection.
Add [flat-value] adjustment [type] to [ShoppingCart] based on [comparison] of [OrderData] to [threshold] This is an activation on the Shopping Cart that adds a flat adjustment to the cart based on how the specified order data parameter compares to the threshold parameter. An adjustment in this context represents a fee or discount on the total order.
Add [flat-value] adjustment [type] to [ShoppingCart] if [ASPServer] variable matches [value] This is an interaction between the Shopping Cart and a basement Session element that adds a percentage adjustment to the cart if the specified Session variable matches the specified value. An adjustment in this context represents a fee or discount on the total order and is set with the 'AdjustmentType' parameter. You could potentially use this interaction to apply a preferred customer discount on the total order.
Add [flat-value] adjustment [type] to [ShoppingCart] when [button] is clicked (requires submit) This is an interaction between the ShoppingCart and a button that adds a flat adjustment to the cart without any data criterion constraints. An adjustment in this context represents a fee or discount on the total order and is set using the 'AdjustmentType' parameter. Use this contract to provide an 'optional' adjustment based on the user's selection.
Set line-item [type] discount from [Recordset] in [ShoppingCart] if [data] threshold is met when [button] is clicked This is an interaction between the Shopping Cart, a recordset and a button that will determine whether a line item discount should be applied on a particular product based on criteria stored for that product in the recordset. The recordset stores a threshold for receiving the discount and the discount rate.
Set line-item discount in [ShoppingCart] if threshold is met based on criteria in [Recordset] when [button] is clicked This is an interaction between the ShoppingCart, a recordset and a button that will determine whether a line item discount should be applied on a particular product based on criteria stored for that product in the recordset. As opposed to the other line-item discount contract, this contract allows you to set a discount based on type (that is, flat vs.
Add flat adjustment [type] from [Recordset] schedule based on [ShoppingCart] data This is an extension of the related ShoppingCart activation that adds a flat adjustment to the cart based on how the specified order data parameter compares to the threshold parameter. In this case, however, the Shopping Cart interacts with a recordset that contains ranges of the specified order data and associated adjustment rates.
Add percentage adjustment [type] from [Recordset] schedule based on [ShoppingCart] data This is an extension of the related Shopping Cart activation that adds a percentage adjustment to the cart based on how the specified order data parameter compares to the threshold parameter. In this case, however, the Shopping Cart interacts with a recordset that contains ranges of the specified order data and associated adjustment rates.
Replace [token] in [target] with value of adjustment [name] from [ShoppingCart] This is an interaction between the ShoppingCart and a text element or edit box that replaces a token with the value of an adjustment whose name is provided as a contract parameter. Various formatting options are available as parameters to the contract that allow you to optionally display a negative sign for discounts and a currency symbol.
Replace [token] in [target] with adjustments total from [ShoppingCart] This is an interaction between the ShoppingCart and a text element or edit box that replaces a token with the sum total of adjustments currently applied to the cart. This contract simply returns a string representation of a number formatted to two decimal places. There are no currency symbol options in this contract. This contract can be used to display the total quantity of discounts that a shopper received, for instance.
Insert adjustments from [ShoppingCart] in [Recordset] when [button] is clicked using OrderID from [HiddenFormElement] This contract is an interaction between a basement ShoppingCart element, a submit button, a Hidden Form Element and the destination Recordset for the Cart data. This contract can be used when the order information is submitted on a previous page and redirected to a confirmation page, where the OrderID generated from the previous page is assigned to a form element.
Insert adjustments from [ShoppingCart] in [Recordset] when [button] is clicked using OrderID from [ASPServer] Similar to its Hidden Form Element counter part, this contract is an interaction between a basement ShoppingCart element, a submit button, an ASPServer object and the destination Recordset for the Cart adjustments.
Do not create [target] if [adjustment] exists in [ShoppingCart] Will not show the target participant if the specified adjustment exists in the shopping cart. Parameters: AdjustmentName is the name of the shopping cart adjustment used to determine if the target will be shown Participants: Shopping Cart Target (image, button, text element, etc.) Create [target] only if [adjustment] exists in [ShoppingCart] Will only show the target participant if the specified adjustment exists in the shopping cart.
Inventory Control The service release of Drumbeat eStore builder includes several new inventory related capabilities that are enabled through the eStore inventory contracts. The use of these contracts is illustrated in DrumNote_508. Replace [token] in [target] with product availability from [recordset] This is an interaction between a recordset and a text element or hidden form element that replaces a token with the availability of a given product.
Show [image] based on availability from [recordset] This contract is conceptually similar to the "Replace [token] in [target] with product availability from [recordset]" contract, except that an 'in-stock' image is shown when the product is in stock, otherwise, an 'out-of-stock' image is shown. The contract assumes that the recordset contains the columns to store the units in stock, the units on order and the reorder level.
Update inventory in [Recordset] with [ShoppingCart] data when [button] is clicked Use this contract when an order is being captured to increment the 'UnitsOnOrder' column of the products recordset by the number of items being ordered for each product in the shopping cart. This is an interaction between the shopping cart, a recordset and a button. Note: This contract should be executed before the Cart contents are inserted into the OrderDetails recordset, a process that destroys the cart.
Do not create [target] if the quantity of any product in [OrderDetailsRS] exceeds stock levels in [ProductRS] Will not show the target participant if any product specified in the OrderDetailsRS does not have sufficient quantity in stock to fulfill the quantity ordered.
Create [target] if the quantity of any product in [OrderDetailsRS] exceeds stock levels in [ProductRS] This contract is the opposite of the "Do not create [target] if the quantity of any product in [OrderDetailsRS] exceeds stock levels in [ProductRS]" contract. It will only show the target participant if any product specified in the OrderDetailsRS does not have sufficient quantity in stock to fulfill the quantity ordered. This would typically be used to display a message such as "Cannot fulfill this order.
Update inventory in [ProductsRS] with [OrderDetailsRS] data when [button] is clicked This contract updated the inventory data in the Products recordset when an order is fulfilled by clicking a button. This contract is intended to be used in conjuction with an update contract on the order record. In other words, the page should contain and Orders and OrderDetails recordset filtered on the OrderID so that they are showing data for the same order.
10 CHAPTER 10 CyberCash SmartElement Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The Drumbeat CyberCash SmartElement enables CyberCash transaction services in an online store.
CyberCash Features Supported CyberCash provides a full array of credit card services that includes authorization, capture, voids, returns, etc. Currently, the Drumbeat CyberCash SmartElement provides the capability to 'authorize' and 'capture' credit card charges. In the terminology of credit card processing, 'authorization' means verifying that the credit card has sufficient credit to cover the requested purchase.
Run-Time Attributes The following attributes are customer and order-related variables sent to or returned from the CyberCash CashRegister. Because these are specific to a particular customer and order, they are only accessible at run-time and are set using associated CyberCash contracts.
CyberCash Interactions The Drumbeat CyberCash contracts interact with the CyberCash SmartElement to enable CyberCash transaction services in an online store. While setting up and using the CyberCash element is easy, you will still need to register as a merchant with CyberCash, install and configure the CyberCash Merchant Connection Kit (MCK), and set up bank accounts for your commerce sites before you can go live. For information on the CyberCash configuration process, visit CyberCash at www.cybercash.
Set [CyberCash] to value from [Recordset] when [button] is clicked A series of interactions between the CyberCash SmartElement, a Recordset, and a button that submits the page. There are interactions for each of the CyberCash element's credit card-related properties. Each of these contracts includes a parameter that specifies the column name in the recordset that contains the appropriate data.
Submit [CyberCash] data for processing when [button] is clicked This contract between the CyberCash element and a button that submits the page sends data to the CyberCash CashRegister for processing and stores the transaction results in the CyberCash SmartElement. This contract must be applied after all of the 'Set' contracts have been applied.
Order is Important There are two requirements for proper ordering. First, the contracts must be applied in the proper order, with the battery of 'Set' contracts being applied before the 'submit' contract, which in turn have to be applied before the contracts to respond to transaction results. This mimics the order requirements of processing a transaction: gathering required data, submitting data to CyberCash, and getting the response back. Second, the order of basement SmartElements is important.
Version 2.0 Contracts Populate [ListElement] with UPS options using weight from [ShoppingCart] and billing info from [recordset] This is a server-side contract that populates a dropdown list with available UPS shipping options and corresponding shipping costs. After the contract executes, the dropdown list will display each available shipping option. The corresponding value stores both the ship method and cost in a delimited string of the form "ShipMethod:ShipCost.
Populate [ListElement] with ship options from [Recordset] using weight from [ShoppingCart] This contract creates a dropdown list of ship options from a recordset containing various ship methods from various carriers based on a single rate zone. The recordset is built from a table that contains a specified zone from the carriers shipping rate tables. These can be downloaded from the various carriers’ websites.
For example, suppose you choose to charge Zone 7 ship rates by default and you are a merchant in California. The ship cost for customers on the Eastern seaboard probably corresponds to Zone 8 rates. By supplying a list of states on the eastern seaboard (i.e., NY, RI, VT, etc) and an alternate zone of Zone8, you can charge customers in these states Zone 8 rates. After the contract executes, the dropdown list will display each available shipping option.
Set shipping in [ShoppingCart] to value of [ListElement] containing ship data Sets the shipping property of the Shopping cart to the cost value of the selected option from a list element that contains ship costs in the value of each list option. This is a general contract to be used with list elements that are populated manually. IT SHOULD NOT BE USED WITH LISTS POPULATED USING THE SPECIALIZED 'POPULATE LIST ELEMENT...
Set shipping in [ShoppingCart] to [flat-rate] shipping based on total order quantity This is a server-side contract that sets the ShoppingCart shipping property to a shipping value based on a flat-rate shipping charge for each item ordered. The number of items ordered is determined from the shopping cart. For instance, suppose you have 5 items ordered, and you specify a flat rate of 5.00 per item. The contract will return a shipping charge of 25.00.
Use [ShipList] data to update/insert in [ShipViaCol] and [ShipCostCol] of [Recordset] when [button] is clicked Inserts/updates a recordset with data from a list element that is populated via the 'Populate list element..." contracts from eStore version 2. This contract inserts the list element's 'value' attribute. The corresponding value stores both the ship method and cost in a delimited string of the form "ShipMethod:ShipCost.
Replace [token] in [target] with value of grand total from [ShoppingCart] This is an interaction between the ShoppingCart and a text element or edit box that replaces a token with the value of the shopping cart's grand total. This is determined as the sum of the shopping cart's adjusted total, shipping and sales tax. Parameters: Token is the case sensitive text in the text element to be replaced with the shopping cart grand total value.
Set value in [grandtotal] to sum of [EditBoxes] when [ShipList] changes This is a client-side contract that calculates a grand total as the sum of values contained in edit boxes when the selected shipping option of a dropdown list is changed. This contract is specifically intended for use with a dropdown populated with UPS shipping options. In this contract, any number of edit boxes can be used to calculate the sum.
Replace [token] in [target] with shipping value from [recordset] based on [ShoppingCart] data This is a server-side contract that replaces a token in a text element or edit box with a shipping value from a lookup recordset based on the weight or purchase price of an order containined in the shopping cart.
Replace [token] in [target] with sum of [ShoppingCart] adjusted subtotal, shipping, and tax This is a server-side contract that replaces a token in a text element or edit box with a the sum of the ShoppingCart subtotal, a shipping value contained in another text element, and a sales tax value contained in yet another text element. This is useful for displaying a "grandtotal' cost value on a page in your eCommerce site.
Known Issues With Using UPS Shipping Contracts The UPS shipping contracts allow you to present UPS shipping options and calculate shipping costs based on input parameters for an order in your online store. Currently, the contracts only support shipping calculation for UPS. The shipping calculations rely on passing input data from your order to a UPS cgi script. Because the cgi script returns its own page, there is no direct way to grab and manipulate the returned information from within Drumbeat.
Sales Tax Interactions Set sales tax in [ShoppingCart] to tax value from [TaxRS] using state from [CustomerRS] This contract sets the shopping cart sales tax property based on the sales tax rate for the customers billing state and the current value for the shopping cart's adjusted subtotal. If the customer's billing state is in a state in which you are responsible for sales tax, the tax will be calculated from the adjusted subtotal based on that state's sales tax rate, otherwise, "0.00" will be displayed.
Replace [token] in [target] with value of sales tax from [ShoppingCart] Replaces a token in a text element, edit box, or hidden form element with the value of the shopping cart's sales tax property. Use the "Set sales tax in [ShoppingCart] to tax value from [TaxRS] using state from [CustomerRS]" contract to calculate this value. Parameters: Token is the exact case sensitive text the will be repaced with the cart's sales tax value.
Replace [token] in [target] with sales tax from [TaxRS] using [ShoppingCart] total and state from [CustomerRS] Note: This contract was initially developed between the version 1 and version 2 releases of eStore and is deprecated in favor of the version 2 contract "Set sales tax in [ShoppingCart] to tax value from [TaxRS] using state from [CustomerRS]" This contract replaces a token in an edit box with the sales tax for the customers billing state.
Chapter 10
INDEX A Active Server Pages publish settings 80 security 123 server application support 80 site preferences 80 Add-to-Cart button, adding to shopping page 102 adjustments purchase 137 quantity 137 Shopping Cart contracts 194 weight 137 Adjustments Array, shopping cart API methods 155 authentication 123 authorization 125 B bindings array, shopping cart API methods 154 C checkout 111 checkout area, creating new/update user pages 115 checkout page creating 118 customer information 118 displaying Shopping Cart
P password, login 112 payment processing 125 SET 123 product pages setting up 79 Shopping Cart SmartElements 91 using DataForm wizard 79 products database 79 Publish Settings, set up for ASP 80 Q query, create 82 Quick Store, customizing 143 R Recordset SmartElement, DataForms 88 redirection, login 113 S sales tax reference 233 shopping cart API methods 154 security 121 ASP 123 authentication and login 123 databases 122 HTTPS protocol 122 SET, payment processing 123 setting up product pages 79 settlement 12