Using the Add to Cart Button

The Add to Cart Button adds items to the shopping cart and passes all information pertinent to the configured item to the shopping cart.

Item information is stored within the shopping cart columns that are defined in the eCart Object specific to your shopping cart implementation. See Columns in the section Understanding the eCart Object for more information on configuring shopping cart columns.

The Add to Cart Button is flexible in terms of defining information that populates the columns of the shopping cart. You can specify column data:
  • statically during the configuration of the button
  • dynamically from a database using a recordset, or other server-side code reference
  • using a form field associated to the button, allowing the user to control column data (e.g. Quantity)
Configuration of the Add to Cart Button is broken into three tabs within the Add to Cart Button dialog, each of which is discussed in detail in the following sections:
  • General configuration: configures whether the button uses static information, or information retrieved from a recordset to populate shopping cart columns when an item is added to the shopping cart. Also specifies the default redirect location for the button when clicked.
  • Bindings configuration: configures the information that populates each shopping cart column for the item. Information can be specified statically within the interface, or can be retrieved from a recordset or server-side code. As well, the redirect action and display configuration for the item within the shopping cart display can be further customized.
  • Button configuration: specifies the image or form button used for the display of the button, as well as the ALT text if an image is used.
Note: Applying and configuring the Add to Cart Button is discussed in detail in the tutorials provided with this extension. Please refer to the Getting started guide to learn more about configuring the Add to Cart Button specific to your needs.

Feature access

The Add to Cart Button is available for insert from the following locations:
  • eCart Insert panel

  • Insert > WebAssist > eCart > Add to Cart Button
  • Server Behaviors > WA eCart > Add to Cart

To insert the Add to Cart Button:

  1. In Design View, place your cursor in the location where the Add to Cart button is to be placed.
  2. In the eCart Insert panel, click the eCart Add to Cart Button icon (see Feature access above).

    The configuration dialog box will open.
  3. Configure the button specific to your needs, as outlined in the sections detailed above.
  4. Click OK to apply the button to the page.

    A form is placed on the page that contains:
    • a hidden field containing the ID of the item
    • all fields that allow the user to specify column data (e.g. Quantity)
    • a form button or image button, depending on your configuration


    In addition, server-side code is placed at the top of the page that contains all the configuration information specific to the item.

To modify the Add to Cart button:

  1. In the Server Behaviors panel of the Application panel group, click the eCart Add to Cart listing which corresponds to the button to be modified.

    The configuration dialog box will open.
  2. Make any necessary configuration changes.
  3. Click OK to apply the changes to the page.