Skip to main content

ShoppingModule

Class

Allows the creation of Shopping Lenses with an integrated Product Catalog.

  • Snapchat: not supported
  • SPECS: not supported
  • Camera Kit Web: fully supported
  • Camera Kit Mobile: fully supported
  • SnapchatNot supported — Available on Camera Kit only
  • SPECSNot supported — Available on Camera Kit only
  • Camera Kit WebFully supported
  • Camera Kit MobileFully supported

Platform details

  • Snapchat — Not supported — Available on Camera Kit only.

  • SPECS — Not supported — Available on Camera Kit only.

  • Camera Kit Web — Fully supported.

  • Camera Kit Mobile — Fully supported.

Since Lens Scripting v153

Allows the creation of Shopping Lenses with an integrated Product Catalog. Not available on Spectacles.

Index

Remarks

The ShoppingModule includes several input fields for you to define as you create your Shopping Lens. The fields include:

Domain: name of the product line (e.g., Running Shoes). Description: (of the domain): description of the domain (e.g., Winter Season Collection). State(s): name of the single product displayed in that state (e.g., Shoe ABC). Description (of each state): description of the product in the state (e.g., SKU ID 12345, red shoe).

Extends

Properties

domains

readonly domains: DomainInfo[]

Camera Kit

The domain within this shopping module.

Since

Lens Scripting Version 168


name

name: string

The name of the Asset in Lens Studio.

Default Value

""

Inherited from

Asset.name


onError

readonly onError: event2<number, string, void>

Camera Kit

Triggered when an error has occured on the module.

Since

Lens Scripting Version 153


onProductsLoaded

readonly onProductsLoaded: event1<string, void>

Camera Kit

Since

Lens Scripting Version 321


onProductStateUpdate

readonly onProductStateUpdate: event1<string, void>

Camera Kit

Triggered when the client (e.g. Snapchat) has changed the product state.

Since

Lens Scripting Version 153


uniqueIdentifier

readonly uniqueIdentifier: string

Since

Lens Scripting Version 176

Inherited from

Asset.uniqueIdentifier

Methods

getTypeName()

static getTypeName(): TypeName<ShoppingModule>

Camera Kit

Returns the fully-qualified JavaScript type name for this class (for example, "Component.Camera"). This is a static accessor (no instance required) and returns the same value as the instance getTypeName().

Returns

TypeName<ShoppingModule>

Since

Lens Scripting Version 153

Overrides

Asset.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

Asset.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object matches or derives from the passed in type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

Asset.isOfType


isSame()

isSame(other): boolean

Returns true if this object is the same as other. Useful for checking if two references point to the same thing.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

Asset.isSame


loadingStarted()

loadingStarted(): ShoppingLoadingIndicator

Camera Kit

Returns the status of whether the module has loaded.

Returns

ShoppingLoadingIndicator

Since

Lens Scripting Version 162


selectProduct()

selectProduct(index): void

Camera Kit

Parameters

ParameterType
indexnumber

Returns

void

Since

Lens Scripting Version 321

See also

Shopping Lens guide.