Class ProductMgr

Provides helper methods for getting products based on Product ID or Catalog.

This class does not have a constructor, so you cannot create it directly.

MethodDescription
static getProduct(String)Returns the product with the specified id.
static queryAllSiteProducts()Returns all products assigned to the current site.
static queryAllSiteProductsSorted()Returns all products assigned to the current site.
static queryProductsInCatalog(Catalog)Returns all products assigned to the the specified catalog, where assignment has the same meaning as it does for queryAllSiteProducts().
static queryProductsInCatalogSorted(Catalog)Returns all products assigned to the the specified catalog.

assign, create, create, defineProperties, defineProperty, entries, freeze, fromEntries, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, getPrototypeOf, hasOwnProperty, is, isExtensible, isFrozen, isPrototypeOf, isSealed, keys, preventExtensions, propertyIsEnumerable, seal, setPrototypeOf, toLocaleString, toString, valueOf, values

static getProduct(productID: String): Product

Returns the product with the specified id.

Parameters:

  • productID - the product identifier.

Returns:

  • Product for specified id or null

static queryAllSiteProducts(): SeekableIterator

Returns all products assigned to the current site.

A product is assigned to a site if

  • it is assigned to at least one category of the site catalog or
  • it is a variant and it's master product is assigned to the current site

It is strongly recommended to call close() on the returned SeekableIterator if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources.

Returns:

  • Iterator of all site products

See Also:


static queryAllSiteProductsSorted(): SeekableIterator

Returns all products assigned to the current site.

Works like queryAllSiteProducts(), but additionally sorts the result set by product ID.

It is strongly recommended to call close() on the returned SeekableIterator if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources.

Returns:

  • Iterator of all site products sorted by product ID.

See Also:


static queryProductsInCatalog(catalog: Catalog): SeekableIterator

Returns all products assigned to the the specified catalog, where assignment has the same meaning as it does for queryAllSiteProducts().

It is strongly recommended to call close() on the returned SeekableIterator if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources.

Parameters:

  • catalog - The catalog whose assigned products should be returned.

Returns:

  • Iterator of all products assigned to specified catalog.

See Also:


static queryProductsInCatalogSorted(catalog: Catalog): SeekableIterator

Returns all products assigned to the the specified catalog. Works like queryProductsInCatalog(), but additionally sorts the result set by product ID.

It is strongly recommended to call close() on the returned SeekableIterator if not all of its elements are being retrieved. This will ensure the proper cleanup of system resources.

Parameters:

  • catalog - The catalog whose assigned products should be returned.

Returns:

  • Iterator of all products assigned to specified catalog sorted by product ID.

See Also: