By default, Core Commerce includes a session-scoped instance of ProductComparisonList
, located in Nucleus at /atg/commerce/catalog/
. However, your application developers may have configured additional instances of
comparison/ProductListProductComparisonList
to manage multiple comparison lists (for example, a list to compare cameras, a different list to compare televisions, and so on).
The items
property of the ProductList
component stores the list of Entry
objects that represent each product in the product comparison list. Each Entry
object combines category, product, SKU, and inventory information in a single object and, by default, exposes the properties described in the table below. (Note that your developers may have extended the product comparison system and added additional properties.)
Property Name | Property Type | Description |
---|---|---|
|
| The product being compared. |
|
| The category of the product being compared. If the category is not set explicitly when the product is added to the list, then the product’s default parent category is used. If the product’s default parent category is unset, the |
|
| The product’s SKU. If the SKU is not set explicitly when the product is added to the list, then the first SKU in the product’s |
|
| The |
|
| An HTML fragment that specifies an anchor tag that links to the product’s page in the catalog. The default format for the link is Note: If you display the product comparison information in a table, you can use the
Or, similarly, to display the product link in a table column but sort the column on the product’s display name, you could modify the example in the following manner:
For more information on the |
|
| An HTML fragment that specifies an anchor tag that links to the category’s page in the catalog. The default format for the link is Note: Like the |
|
| A unique ID that names the list entry. You can use this property to retrieve individual entries by calling |
You can refer to the properties of entries in the product comparison list (that is, the Entry
objects) using familiar JSP syntax, as in the following example:
<dsp:droplet name="ForEach"> <dsp:param bean="ProductComparisonList.items" name="array"/> <dsp:oparam name="output"> <p>Product Name: <dsp:valueof param="element.product.displayName"/><br> Category: <dsp:valueof param="element.category.displayName"/><br> Inventory: <dsp:valueof param="element.inventoryInfo.inventoryAvailabilityMsg"/><br> </dsp:oparam> </dsp:droplet>