QueryCatalogInfo
Use this component to retrieve catalog information for every item in the order form.
Note
- This component replaces the older QueryProdInfoADO component. The QueryCatalogInfo component works with the new Commerce Server 2000 catalog structure rather than performing product table lookups.
Intended use: Order Processing pipeline, Product Info stage.
Configuration Values
You can determine which product properties the QueryCatalogInfo component retrieves by setting component properties. Use the following box on the Query Catalog Info tab of the Component Properties dialog box to determine this information.
Box | Description |
Columns | A comma-separated list of product properties to retrieve from the catalog system. Leave blank to retrieve all product properties. |
Values Read
The QueryCatalogInfo component reads the following values from the indicated dictionary.
Key | Dictionary | Description |
CacheManager |
Context | A reference to a CacheManager object. |
CatalogManager |
Context | A reference to a CatalogManager object. |
item.product_catalog |
Context | String. The catalog containing the item. |
item.product_id |
Context | String. The product identifier. |
item.product_variant_id |
Context | Optional. String. An additional identifier used to distinguish variants of a particular product such as different colors of an item. |
Values Written
The QueryCatalogInfo component writes the following values to the Order dictionary.
Key | Description |
item._product_* |
Product properties for each item. The column name is appended to form the key name. For more information, see the Remarks section. |
item.delete |
A flag indicating the item should be deleted from the order. For more information, see the Remarks section. |
Remarks
The QueryCatalogInfo component retrieves product information from the catalog system for every item in the order. It adds the retrieved information to each Item dictionary in the order form.
The Columns box contains a comma-separated list of properties to retrieve from the catalog. If the Columns box is left blank, the QueryCatalogInfo component retrieves all product properties related to each item.
Items are identified by a combination of the product
_catalog
, product
_id
, and product
_variant
_id
keys. The product
_variant
_id
key is required only if the product is a variant, such a particular color of an item that comes in multiple colors.
If no data is found for an item, the QueryCatalogInfo component marks the item for deletion by creating a key in the Item dictionary. The key, delete
, is assigned a value of one (1). The RequiredProdInfo component checks for this flag and deletes the item if the key is found. Typically, this deletion occurs when an item in the basket is removed from a catalog.
If data for an item is found, the QueryCatalogInfo component writes an entry to the corresponding Item dictionary for each property specified in the Columns box (or for every property if nothing was specified in the Columns box). The name of the entry is the prefix _product
_ followed by the property name. For example, a product property named "weight", would be stored as _product
_weight
. The value of the entry is set to the corresponding data from the catalog system.
The QueryCatalogInfo component requires a CacheManager object with a QueryCatalogInfoCache datastructure in its PipeContext Dictionary. The QueryCatalogInfo component uses this data structure to cache the product and category information it applies to line items
The following code is used to setup the cache in the global.asa file.
' Initialize dictQCICacheConfig
Set dictQCICacheConfig = Server.CreateObject("Commerce.Dictionary")
dictQCICacheConfig("ConnectionString") _
= _dictConfig.s_TransactionConfigConnectionString
dictQCICacheConfig("CacheSize") = 10000
dictQCICacheConfig("TableName") = "CatalogCache_Virtual_Directory"
dictQCICacheConfig("CacheName") = "CatalogCache"
dictQCICacheConfig("AppUrl") = sMachineBaseURL
' Configure CacheManager For QueryCatalogInfoCache
oCacheManager.RefreshInterval("QueryCatalogInfoCache") = 60 * 60
oCacheManager.RetryInterval("QueryCatalogInfoCache") = 5 * 60
oCacheManager.CacheObjectProgId("QueryCatalogInfoCache") _
= "Commerce.LRUCache"
oCacheManager.LoaderProgId("QueryCatalogInfoCache") _
= "Commerce.LRUCacheFlush"
Set oCacheManager.LoaderConfig("QueryCatalogInfoCache") _
= dictQCICacheConfig