Share via


Code to Stage Products and Catalogs by Time

Normally, catalog data is visible to your users as soon as it is placed in the Product Catalog System. It is possible to automatically activate products in a catalog at a pre-determined time or date by adding an additional property and then filtering on that property. A similar technique can be used to deactivate products.

The following steps show how to stage products and catalogs by time.

  1. Define a new property of type Date and call it "AvailableFrom." Set the AssignToAll attribute to True and the DisplayOnSite attribute to False.

  2. When creating or editing products, you can specify a value for the AvailableFrom property, which indicates the date and time that the product should become visible on your Web site.

  3. Filter any recordsets of products, such as those returned from the Category.ProductsCatalogManager.QueryCatalogManager.FreeTextSearchProductCatalog.GuaranteedSpecificationSearchProductCatalog.PerformSpecificationSearch methods by specifying an ActiveX Data Object (ADO) filter on the recordset as "AvailableFrom<=NOW". (Where NOW must be replaced by the current date and time, appropriately formatted.)

For example, where you have code like:

rsProducts = oCatalog.GetCategory(strCategoryName).Products

You need to follow it with:

rsProducts.filter = "AvailableFrom <= " & format(Date, General Date)

This prevents products from being visible on your Web site until the date and time specified.

Ee797697.note(en-US,CS.10).gif Note

  • Caching of HTML may prevent products from appearing on your Web site until the cache is flushed.


All rights reserved.