User Guide

Shopping Cart Reference 191
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. In this context, the "these
products" refer to the list of products in the Recordset participant, while the "this
product" refers to a product in the ProductsRecordset particpant.
The contract will replace a token in the text element with a list of related
products, excluding the current product being shown and any products that are
already in the shopping cart. Each item in the product list is a link to a detail for
that product.
There are several important database requirements and somewhat complex SQL
for this to work. These are outlined in detail in DrumNote_511.
Parameters:
LinkDestination page is the destination for linking from the product in the list
to a detail for that product.
ProductIDColumn is the name of the column in the Recordset (the one that
contains the list of related products) that contains the unique ID for the
given product.
ProductNameColumn is the name of the column in the Recordset (the one
that contains the list of related products) that contains the name for the given
product that will be used in the displayt list.
Token is the exact case-sensitive text that will be replaced by the list of
related products.
Top N specifies the number of products to be shown in the list. The SQL used
to generate the list is sorted in descending order of the number of times the
related product was ordered by a customer who ordered the current product in
the ProductRecordset participant.
Participants:
ProductRecordset is the recordset that contains the current product for which
the related products list will be generated
Recordset is the recordset that contains the list of related products for the
current product in ProductRecordset
ShoppingCart
TextElement