Skip to main content

Type Alias: GetShortcode()

GetShortcode: (productId, variantCode?) => Promise<string>

When called it will generate unique shortcode for given productId-configurationCode pair. For the same pair shortcode is always the same. Calls statsService /generate-product-short-code endpoint.

This method works only for regular products. In case of modular Short Code is returned as part of `mimeeq-add-to-cart` event.
Since version 6.7.0 short code is returned in `mimeeq-add-to-cart` for all products. It's preferable to use that value instead of calling this method.

Parameters

productId

string

Id of the product

variantCode?

string

Selected configuration code string

Returns

Promise<string>

Generated short code