Edit in GitHubLog an issue
Adobe Commerce only. Learn more

Context for storefront events

Functions

The following functions get and set context data.

mse.context.getCategory

Gets the Category context.

Syntax:

Copied to your clipboard
mse.context.getCategory();

mse.context.getCustomUrl

Gets the CustomUrl context.

Syntax:

Copied to your clipboard
mse.context.getCustomUrl();

mse.context.getMagentoExtension

Gets the MagentoExtension context.

Syntax:

Copied to your clipboard
mse.context.getMagentoExtension();

mse.context.getOrder

Gets the Order context.

Syntax:

Copied to your clipboard
mse.context.getOrder();

mse.context.getPage

Gets the Page context.

Syntax:

Copied to your clipboard
mse.context.getPage();

mse.context.getProduct

Gets the Product context.

Syntax:

Copied to your clipboard
mse.context.getProduct();

mse.context.getRecommendations

Gets the Recommendations context.

Syntax:

Copied to your clipboard
mse.context.getRecommendations();

mse.context.getReferrerUrl

Gets the ReferrerUrl context.

Syntax:

Copied to your clipboard
mse.context.getReferrerUrl();

mse.context.getSearchInput

Gets the SearchInput context.

Syntax:

Copied to your clipboard
mse.context.getSearchInput();

mse.context.getSearchResults

Gets the SearchResults context.

Syntax:

Copied to your clipboard
mse.context.getSearchResults();

mse.context.getShopper

Gets the Shopper context.

Syntax:

Copied to your clipboard
mse.context.getShopper();

mse.context.getShoppingCart

Gets the ShoppingCart context.

Syntax:

Copied to your clipboard
mse.context.getShoppingCart();

mse.context.getStorefrontInstance

Gets the StorefrontInstance context.

Syntax:

Copied to your clipboard
mse.context.getStorefrontInstance();

mse.context.getContext

Gets a custom Context.

NameRequiredDescription
name
Yes
Context name

Syntax:

Copied to your clipboard
mse.context.getContext(name);

mse.context.setCategory

Sets the Category context.

NameRequiredDescription
context
Yes
Category context

Syntax:

Copied to your clipboard
mse.context.setCategory(categoryCtx);

mse.context.setCustomUrl

Sets the CustomUrl context.

NameRequiredDescription
context
Yes
CustomUrl context

Syntax:

Copied to your clipboard
mse.context.setCustomUrl(customUrlCtx);

mse.context.setMagentoExtension

Sets the MagentoExtension context.

NameRequiredDescription
context
Yes
MagentoExtension context

Syntax:

Copied to your clipboard
mse.context.setMagentoExtension(magentoExtensionCtx);

mse.context.setOrder

Sets the Order context.

NameRequiredDescription
context
Yes
Order context

Syntax:

Copied to your clipboard
mse.context.setOrder(orderCtx);

mse.context.setPage

Sets the Page context.

NameRequiredDescription
context
Yes
Page context

Syntax:

Copied to your clipboard
mse.context.setPage(pageCtx);

mse.context.setProduct

Sets the Product context.

NameRequiredDescription
context
Yes
Product context

Syntax:

Copied to your clipboard
mse.context.setProduct(productCtx);

mse.context.setRecommendations

Sets the Recommendations context.

NameRequiredDescription
context
Yes
Recommendations context

Syntax:

Copied to your clipboard
mse.context.setRecommendations(recommendationsCtx);

mse.context.setReferrerUrl

Sets the ReferrerUrl context.

NameRequiredDescription
context
Yes
ReferrerUrl context

Syntax:

Copied to your clipboard
mse.context.setReferrerUrl(referrerUrlCtx);

mse.context.setSearchInput

Sets the SearchInput context.

NameRequiredDescription
context
Yes
SearchInput context

Syntax:

Copied to your clipboard
mse.context.setSearchInput(searchInputCtx);

mse.context.setSearchResults

Sets the SearchResults context.

NameRequiredDescription
context
Yes
SearchResults context

Syntax:

Copied to your clipboard
mse.context.setSearchResults(searchResultsCtx);

mse.context.setShopper

Sets the Shopper context.

NameRequiredDescription
context
Yes
Shopper context

Syntax:

Copied to your clipboard
mse.context.setShopper(shopperCtx);

mse.context.setShoppingCart

Sets the ShoppingCart context.

NameRequiredDescription
context
Yes
ShoppingCart context

Syntax:

Copied to your clipboard
mse.context.setShoppingCart(shoppingCartCtx);

mse.context.setStorefrontInstance

Sets the StorefrontInstance context.

NameRequiredDescription
context
Yes
StorefrontInstance context

Syntax:

Copied to your clipboard
mse.context.setStorefrontInstance(storefrontCtx);

mse.context.setContext

Sets a custom Context.

NameRequiredDescription
name
Yes
Context name
context
Yes
Custom context

Syntax:

Copied to your clipboard
mse.context.setContext(ctx);
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.