The atg.projects.store.assembler.cartridge.CategoryRelatedProductsContentItem
class represents the content item that the ProductSpotlight-ATGCategoryRelatedProducts
cartridge returns to the renderer. The CategoryRelatedProductsContentItem
class has three properties:
categoryId
: The ID of the current category.numberOfRecords
: The number of cross-sell products to be displayed.relatedProducts
: The list of related products for the current category.
The /atg/endeca/assembler/cartridge/handler/CategoryRelatedProducts
component, which is of class atg.projects.store.assembler.cartridge.handler.CategoryRelatedProductsHandler
, is responsible for creating and populating the CategoryRelatedProductsContentItem
object. The CategoryRelatedProductsHandler
class is an extension of the com.endeca.infront.cartridge.NavigationCartridgeHandler
class.
The CategoryRelatedProducts
component uses the methods provided by the /atg/endeca/assembler/cartridge/StoreCartridgeTools
component to get the ID for the current category. Once it has the ID, CategoryRelatedProducts
can retrieve the list of related products for the correct category from the catalog repository. To do this, CategoryRelatedProducts
uses its relatedProductsProperties
property to determine which category item properties contain related products (out of the box, this property is set to a single repository item property, relatedProducts
). CategoryRelatedProducts
then retrieves the related products from those properties. The number of products retrieved is limited by the numberOfRecords
value specified in the cartridge configuration.
CategoryRelatedProducts
may also apply an ATG filter to the list of products it retrieves, for example, to filter out products that are not appropriate for the current site context. The filter to apply is configured by the CategoryRelatedProducts.filter
property. Out of the box, CategoryRelatedProducts.filter
is set to /atg/store/collections/filter/CatalogItemFilter
, which filters out products based on their start and end dates.
The CategoryRelatedProducts
component has the following configurable properties:
relatedProductsProperties
: Lists the category repository item properties that contain related products. Defaults torelatedProducts.
catalogTools
: Specifies whichCatalogTools
component theProductListCategoryChildren
component should use to access product catalog data. Defaults to/atg/commerce/catalog/CatalogTools
.filter
: An optional property that specifies a filter to apply to the related products list. Defaults to/atg/store/collections/filter/CatalogItemFilter
.storeCartridgeTools
: References theStoreCartridgeTools
component thatCategoryRelatedProducts
uses to retrieve the ID of the current category. Defaults to/atg/endeca/assembler/cartridge/StoreCartridgeTools
.