PubSub topics
There are topics included by default with the PubSub
system.
CART_ADD_SUCCESS
Topics that have memory enabled are marked accordingly. As a reminder, having memory enabled for a topic allows a callback function to be triggered for the most recently published message even if the function has subscribed to the topic after the message was published. See Create new topics for more information.
A message is published to this topic whenever a product is successfully added to the cart.
$.Topic(pubsub.topicNames.CART_ADD_SUCCESS).publish(product);
Arguments
product
: A JSON object that includes data for the added product, for
example:
{
"primaryFullImageURL" : "/ccstore/v1/images/?source=/file/v2/products/
mymovie_LARGE.jpg",
"smallImageURLs" : ["/ccstore/v1/images/?source=/file/v2/products/
mymovie_LARGE.jpg&height=300&width=300"],
"orderLimit" : null,
"shippingSurcharges" : null,
"salePrices" : null,
"type" : null,
"listPrices" : null,
"primaryImageAltText" : "My Movie",
"height" : null,
"shippingSurcharge" : null,
"listPrice" : 21.99,
"description" : "A great movie that you should not miss.",
"fullImageURLs" : ["/ccstore/v1/images/?source=/file/v2/products/
mymovie_LARGE.jpg"],
"longDescription" : null,
"unitOfMeasure" : null,
"primaryMediumImageURL" : "/ccstore/v1/images/?source=/file/v2/products/
mymovie_LARGE.jpg&height=475&width=475",
"CountryOfOrigin" : "US",
"mediumImageURLs" : ["/ccstore/v1/images/?source=/file/v2/products/
mymovie_LARGE.jpg&height=475&width=475"],
"primarySourceImageURL" : "/ccstore/v1/images/?source=/file/v2/products/
mymovie_LARGE.jpg&height=300&width=300",
"seoKeywordsDerived" : "My Movie,Psychological Thrillers,Blockbuster,
All Products,Thrillers-Clearance",
"width" : null,
"primaryThumbImageURL" : "/ccstore/v1/images/?source=/file/v2/products/
mymovie_LARGE.jpg&height=100&width=100",
"primarySmallImageURL" : "/ccstore/v1/images/?source=/file/v2/products/
mymovie_LARGE.jpg&height=300&width=300",
"relatedMediaContent" : [],
"active" : true,
"largeImageURLs" : ["/ccstore/v1/images/?source=/file/v2/products/
mymovie_LARGE.jpg&height=940&width=940"],
"salePrice" : null,
"fractionalQuantitiesAllowed" : false,
"primaryLargeImageURL" : "/ccstore/v1/images/?source=/file/v2/products/
mymovie_LARGE.jpg&height=940&width=940",
"relatedProducts" : null,
"weight" : null,
"parentCategory" : null,
"avgCustRating" : 4.5,
"productImagesMetadata" : [{}
],
"id" : "Product_36Exy",
"sourceImageURLs" : ["/ccstore/v1/images/?source=/file/v2/products/
mymovie_LARGE.jpg&height=300&width=300"],
"seoMetaInfo" : null,
"variantValuesOrder" : {},
"length" : null,
"relatedArticles" : [],
"defaultProductListingSku" : null,
"seoDescriptionDerived" : "My Movie,A great movie that you should not miss.",
"parentCategories" : [{
"id" : "cat70011",
"categoryImages" : [],
"route" : "/thrillers-clearance/category/cat70011",
"description" : null,
"longDescription" : null,
"active" : true,
"displayName" : "Thrillers-Clearance",
"repositoryId" : "cat70011"
}
],
"childSKUs" : [{
"salePrices" : null,
"primaryFullImageURL" : null,
"primaryLargeImageURL" : null,
"smallImageURLs" : [],
"thumbnailImage" : null,
"listPrices" : null,
"sourceImageURLs" : [],
"listPrice" : 21.99,
"fullImageURLs" : [],
"productListingSku" : null,
"quantity" : null,
"smallImage" : null,
"unitOfMeasure" : null,
"primaryMediumImageURL" : null,
"mediumImageURLs" : [],
"primarySourceImageURL" : null,
"largeImage" : null,
"primaryThumbImageURL" : null,
"primarySmallImageURL" : null,
"repositoryId" : "Sku_36Fxy",
"thumbImageURLs" : [],
"salePriceEndDate" : null,
"dynamicPropertyMapLong" : {},
"images" : [],
"largeImageURLs" : [],
"salePrice" : null,
"salePriceStartDate" : null,
"fractionalQuantitiesAllowed" : false
}
],
"repositoryId" : "Product_36Exy",
"thumbImageURLs" : ["/ccstore/v1/images/?source=/file/v2/products/
mymovie_LARGE.jpg&height=100&width=100"],
"primaryImageTitle" : "My Movie",
"route" : "/my-movie/product/Product_36Exy",
"brand" : null, "seoUrlSlugDerived" : "My Movie",
"displayName" : "My Movie",
"seoTitleDerived" : "My Movie",
"selectedOptions" : [],
"orderQuantity" : 1
}
Memory enabled
No
CART_READY
A message is published to this topic when the cart is loaded with items, either from local storage for an anonymous shopper or from the persistent cart for a registered shopper, and is ready for use. This topic allows subscribers to access the cart items and their associated product details.
$.Topic(PubSub.topicNames.CART_READY).publish(cart);
Arguments
cart
: The current CartViewModel
. See
the View Model JSDoc for Commerce for details on what this view model contains.
Memory enabled
No
CART_UPDATED
A message is published to this topic when the cart is updated with the latest pricing response and saved to local storage.
$.Topic(pubsub.topicNames.CART_UPDATED).publish(cart);
Arguments
cart
: The current CartViewModel
. See
the View Model JSDoc for Commerce for details on what this view model contains.
Memory enabled
No
HISTORY_PUSH_STATE
A message is published to this topic when a shopper navigates from one page to another or refreshes the page.
$.Topic(PubSub.topicNames.HISTORY_PUSH_STATE).publish(path);
Arguments
path
: The path for the page being navigated to or refreshed, for example, /home
, /cart
, /checkout
, /profile
, and so on.
Memory enabled
Yes
ONERROR_EXCEPTION_HANDLER
A message is published to this topic when a runtime error occurs.
$.Topic(PubSub.topicNames.ONERROR_EXCEPTION_HANDLER).publish(
errorMessage, errorUrl, errorLineNumber);
Arguments
errorMessage
: Contains the error message, for example:
"Uncaught Error: Script error for: //abc.com/EEAdmin/js/ee/js/
atgsvcs-test.js http://requirejs.org/docs/errors.html#scripterror"
errorUrl
: The URL value when the error occurred, for example:
http://localhost:8080/shared/js/libs/oraclejet/libs/require/require.js
errorLineNumber
: The line of code the error occurred in.
Memory enabled
No
ORDER_SUBMISSION_SUCCESS
A message is published to this topic when the submission of an order is successfully completed.
$.Topic(PubSub.topicNames.ORDER_SUBMISSION_SUCCESS).publish(orderDetails);
Arguments
orderDetails
: A JSON array that includes data for the submitted order, for example:
[{
message : " success",
id : "o30501",
uuid : " 14f03075-1376-46dd-9e2c-1448255efa8f"
}]
The properties in the JSON object include:message
: This property has a value of success to indicate the order was submittedsuccessfully.id
: A system-generated ID for the order in the Order-
repository.uuid
: A system-generated universally unique identifier for theorder.
Memory enabled
No
PAGE_CHANGED, PAGE_VIEW_CHANGED
A message is published to these topics when a page has a view change or a context change. A view change means that the page type has changed, for example, from /home
to /checkout
. In this case, both the layout and the data change. A context change occurs when the page type remains the same but the data the page contains changes, for example, /product/prod1
to /product/prod2
.
$.Topic(PubSub.topicNames.PAGE_CHANGED).publish(pageEventData);
Arguments
pageEventData
: A JavaScript object that includes data related to the page change event, for example:
{
pageId:"category"
contextId:"cat60041"
seoslug:"controllers"
previousContextId:"Product_36Exy"
}
The properties in the JavaScript object include:pageId
: An identifier for the page requested that represents either the page type (for example,product
,collection
,home
, and so on) or, for article pages, the page address that has been assigned in the Layout settings (for example,aboutUs
,shipping
, orreturns
, are all pages of type article).contextId
: For contextual pages, acontextId
is included and it may be a product ID, category ID, an order ID, or an order confirmation ID. To determine the ID for a specific product or category, you can view the item’s details on the Catalog page in Commerce. Order and order confirmation IDs are system-generated and cannot be known beforehand but you can check for their existence in the JSON object.seoslug
: An SEO-friendly, internally-generated name for the product or category, based on the product or category name. This property only has a value when changing to a product or category page.previousContextId
: The context ID, if one exists, for the page that was rendered before thePAGE_CHANGED
event occurred
Memory enabled
Yes
PAGE_VIEW_CHANGED
is the same as PAGE_CHANGED
, except that PAGE_VIEW_CHANGED
reloads only the layout, while PAGE_CHANGED
reloads the entire page.
PAGE_READY
A message is published to this topic when all the regions and widgets on a page are loaded.
$.Topic(PubSub.topicNames.PAGE_READY).publish(pageEventData);
Arguments
pageEventData
: A JavaScript object that includes data about the
loaded page, for example:
{
pageId:"category",
contextId:"cat60041",
seoslug:" psychological-thrillers"
previousContextId: null,
pageRepositoryId: "categoryPage"
}
The properties in the JavaScript object include:
pageId
: An identifier for the page requested that represents either the page type (for example,product
,collection
,home
, and so on) or, for article pages, the page address that has been assigned in the Layout settings (for example,aboutUs
,shipping
, orreturns
, are all pages of type article).contextId
: For contextual pages, acontextId
is included and it may be a product ID, category ID, an order ID, or an order confirmation ID. To determine the ID for a specific product or category, you can view the item’s details on the Catalog page in Commerce. Order and order confirmation IDs are system-generated and cannot be known beforehand but you can check for their existence in the JSON object.seoslug
: An SEO-friendly, internally-generated name for the product or category, based on the product or category name. This property only has a value when changing to a product or category page.previousContextId
: The context ID, if one exists, for the page that was rendered before thePAGE_CHANGED
event occurred.pageRepositoryId
: The identifier for the page in the page repository. For the out of the box pages, this value can behomePage
,categoryPage
,profilePage
,checkoutPageWithGiftCard
,userSpacesPage
,orderHistoryPage
,orderDetailsPage
, oruserSpacesSettingsPage
. For any additional pages created in Commerce, a system-generated ID is created, for example, pa100001.
Memory enabled
Yes
PRODUCT_VIEWED
A message is published to this topic when the shopper views a product.
$.Topic(pubsub.topicNames.PRODUCT_VIEWED).publish(product);
Arguments
product
: The current ProductViewModel
.
See the View Model JSDoc for Commerce for details on what this view model contains.
Memory enabled
Yes
SEARCH_RESULTS_UPDATED
A message is published to this topic when search results are retrieved or when an error is returned while searching for a product. If search results are retrieved successfully, those results are published with the message. If an error occurs, the error is published with the message.
$.Topic(pubsub.topicNames.SEARCH_RESULTS_UPDATED).publishWith(searchResults, message);
Arguments
searchResults
: The contents of this argument vary depending on
whether the search was successful or not. If the search was successful, the argument
consists of a JSON object that includes the search results and meta-data about the
search, for example:
{
searchResults : Array[5],
isNewSearch:false,
navigation : Array[5],
pageCount : 15,
pagingActionTemplate : JSONObject,
recordOffSet : 0,
recordsPerPage : 5,
searchAdjustments :JSONObject,
totalRecordsFound : 74
breadcrumbs:JSONObject
}
The properties in the successful search JSON object include:
searchResults
: An array that contains the search results. The following code sample shows what an item in that array might look like:
{
"product.category" : ["Cameras and Camcorders"],
"product.language" : ["en"],
"record.type" : ["camera", "sku-camera"],
"sku.listingId" : ["camera_1"],
"product.priceRange" : ["JPY0 - JPY9"],
"sku.activePrice" : ["3.990000"],
"product.creationDate" : ["1466057558000"],
"sku.url" : ["atgrep:/ProductCatalog/sku-camera/
camerasku_1_55?_product=camera_1&locale=en&priceListPair=
salePrices_listPrices"],
"product.priceListPair" : ["salePrices_listPrices"],
"product.active" : ["1"],
"sku.salePrice" : ["3.990000"],
"sku.creationDate" : ["1466057558000"],
"record.source" : ["ProductCatalog"],
"product.url" : ["atgrep:/ProductCatalog/sku-camera/
camerasku_1_55?_product=camera_1&locale=en&priceListPair=
salePrices_listPrices"],
"sku.availabilityStatus" : ["OUTOFSTOCK"],
"parentCategory.displayName" : ["Cameras and Camcorders"],
"Endeca.Document.Language" : ["en"],
"product.daysAvailable" : ["0"],
"record.type.raw" : ["camera", "sku-camera"],
"sku.baseUrl" : ["atgrep:/ProductCatalog/sku-camera/
camerasku_1_55"],
"product.dateAvailable" : ["1466057558000"],
"sku.repositoryId" : ["camerasku_1_55"],
"product.baseUrl" : ["atgrep:/ProductCatalog/sku-camera/
camerasku_1_55"],
"sku.listPrice" : ["399.990000"],
"sku.onSale" : ["0"],
"record.id" : ["sku-camera-camerasku__1__55..camera__1.en.
salePrices__listPrices"],
"product.route" : ["/digital-compact-system-camera/product/
camera_1"],
"product.longDescription" : ["This digital compact system camera
14.1-megapixel,\n 4/3 Live MOS sensor allows you to
capture sharp photos and record high-definition video footage with
up\n to 1920 x 1080 resolution. Built-in Wi-Fi lets
you easily share stored files.\n "],
"sku.listingOptionIndex" : ["10000"],
"id" : ["camera_1"],
"repositoryId" : ["camera_1"],
"displayName" : "Digital Compact System Camera",
"shippingSurcharge" : 0,
"listPrice" : 399.99,
"salePrice" : null,
"route" : "/digital-compact-system-camera/product/camera_1",
"primaryImageAltText" : ["Digital Compact System Camera"],
"primaryImageTitle" : ["Digital Compact System Camera"],
"primaryLargeImageURL" : "/ccstore/v1/images/?source=
/file/v2/products/OM_D_E_M10_LARGE.jpg&height=940&width=940",
"primarySmallImageURL" : "/ccstore/v1/images/?source=
/file/v2/products/OM_D_E_M10_LARGE.jpg&height=300&width=300",
"primaryThumbImageURL" : "/ccstore/v1/images/?source=
/file/v2/products/OM_D_E_M10_LARGE.jpg&height=100&width=100",
"primaryMediumImageURL" : "/ccstore/v1/images/?source=
/file/v2/products/OM_D_E_M10_LARGE.jpg&height=475&width=475",
"primaryFullImageURL" : "/ccstore/v1/images/?source=
/file/v2/products/OM_D_E_M10_LARGE.jpg",
"childSKUs" : [{
"salePrice" : "3.990000",
"listPrice" : "399.990000",
"repositoryId" : ["camerasku_1_55"],
"largeImage" : {
"url" : "" },
"smallImage" : {
"url" : "" },
"thumbnailImage" : {
"url" : ""
}
}
],
"maxActivePrice" : "399.990000",
"minActivePrice" : "3.990000"
}
isNewSearch
: A Boolean value that specifies whether this is a new search or not.navigation
: An array ofrefinements
elements, each of which contains the refinements available for a given dimension. These refinements are used to present the shopper with a set of refinement links that she can use to further refine the current search results. For example, the following JSON sample shows an excerpt of the refinements available for theproduct.category
dimension:
"refinements": [
{
"multiSelect": false,
"navigationState":
"?N=4058976224&Nr=AND%28product.priceListPair%3AsalePrices_listPrices
%2Cproduct.language%3Aen%29&Nrpp=12&Ntl=en&Ntt=cam&language=en&
searchType=simple&visitId=-14ddf4e9%3A156217da656%3A-582e-10.170.102.150&
visitorId=1298EspxGMOA_YEnEkrCS9sDr1JYUdQ6jpex06ADSHQzGuU30A4",
"contentPath": "\/guidedsearch",
"count": 2,
"@class": "com.endeca.infront.cartridge.model.Refinement",
"siteRootPath": "\/pages\/Default\/services",
"siteState": {
"contentPath": null,
"siteId": "@error:siteNotFound",
"@class": "com.endeca.infront.site.model.SiteState",
"siteDisplayName": null,
"validSite": false,
"properties": {
},
"siteDefinition": null,
"matchedUrlPattern": null },
"label": "All Products",
"properties": {
"dimval.prop.category.ancestorCatalogIds": "cloudLakeCatalog",
"dimval.prop.category.rootCatalogId": "cloudLakeCatalog",
"dimval.prop.displayName_en": "All Products",
"dimval.prop.category.repositoryId": "AllProdPagination",
"dimval.prop.category.catalogs.repositoryId":
"cloudCatalog,cloudLakeCatalog",
"record.id":
"atgrep:\/ProductCatalog\/category\/AllProdPagination?
categoryPath=\/AllProdPagination",
"DGraph.Spec": "AllProdPagination"
}
},
{
"multiSelect": false,
"navigationState":
"?N=3881554706&Nr=AND%28product.priceListPair%3AsalePrices_listPrices%
2Cproduct.language%3Aen%29&Nrpp=12&Ntl=en&Ntt=cam&language=en&
searchType=simple&visitId=-14ddf4e9%3A156217da656%3A-582e-10.170.102.150&
visitorId=1298EspxGMOA_YEnEkrCS9sDr1JYUdQ6jpex06ADSHQzGuU30A4",
"contentPath": "\/guidedsearch",
"count": 1,
"@class": "com.endeca.infront.cartridge.model.Refinement",
"siteRootPath": "\/pages\/Default\/services",
"siteState": {
"contentPath": null,
"siteId": "@error:siteNotFound",
"@class": "com.endeca.infront.site.model.SiteState",
"siteDisplayName": null,
"validSite": false,
"properties": {
},
"siteDefinition": null,
"matchedUrlPattern": null
},
"label": "Blockbuster",
"properties": {
"dimval.prop.category.ancestorCatalogIds": "cloudLakeCatalog",
"dimval.prop.category.rootCatalogId": "cloudLakeCatalog",
"dimval.prop.displayName_en": "Blockbuster",
"dimval.prop.category.repositoryId": "topLeaf",
"dimval.prop.category.catalogs.repositoryId":
"cloudCatalog,SiteContextDummyCatalog,ClassicalMoviesCatalog,
cloudLakeCatalog",
"record.id": "atgrep:\/ProductCatalog\/category\/topLeaf?
categoryPath=\/topLeaf",
"DGraph.Spec": "topLeaf"
}
},
…Additional refinements here…
],
"multiSelect": false,
"@type": "RefinementMenu",
"name": "product.category",
"ancestors": [
],
"displayName": "Category",
"dimensionName": "product.category",
"whyPrecedenceRuleFired": null
},
pageCount
: The total number of pages of records. Each page contains the number of records specified byrecordsPerPage
.pagingActionTemplate
: A JSON object that returns data used to retrieve the next page of search results.
"pagingActionTemplate" : {
"navigationState" :
"?&Ntl=en&Ntt=camera&language=en&searchType=simple",
"contentPath" : "/guidedsearch",
"@class" :
"com.endeca.infront.cartridge.model.NavigationAction",
"siteRootPath" : "/pages/Default/services",
"siteState" : {
"contentPath" : null,
"siteId" : "@error:siteNotFound",
"@class" : "com.endeca.infront.site.model.SiteState",
"siteDisplayName" : null,
"validSite" : false,
"properties" : {},
"siteDefinition" : null,
"matchedUrlPattern" : null
},
"label" : null
}
recordOffset
: Identifies the page being viewed. For example, if you have 12 records per page andrecordOffset = 12
, then page 2 is being viewed.recordsPerPage
: The number of records to show per page, used for pagination controls.searchAdjustments
: A JSON object that contains information about any adjustments made to the original search terms.@type
: Identifies the search adjustments portion of the JSON response.originalSearchTerms
: The original search terms as entered by the shopper, including any wildcards.originalTerms
: The original search terms entered by the shopper, minus any wildcards.
totalRecordsFound
: The total number of records that match the search criteria.breadcrumbs
: A JSON object that provides details on the user actions that led to the current navigation state, for example:
"breadcrumbs" : {
"removeAllAction" : {
"navigationState" : "?Ntl=en&language=en&searchType=simple&
visitId=null&visitorId=null",
"contentPath" : "/guidedsearch",
"@class" :
"com.endeca.infront.cartridge.model.NavigationAction",
"siteRootPath" : "/pages/Default/services",
"siteState" : {
"contentPath" : null,
"siteId" : "@error:siteNotFound",
"@class" : "com.endeca.infront.site.model.SiteState",
"siteDisplayName" : null,
"validSite" : false,
"properties" : {},
"siteDefinition" : null,
"matchedUrlPattern" : null },
"label" : null
},
"refinementCrumbs" : [],
"geoFilterCrumb" : null,
"@type" : "Breadcrumbs",
"endeca:auditInfo" : {
"ecr:innerPath" : "breadcrumbs",
"ecr:resourcePath" : "/pages/Default/services/guidedsearch"
},
"searchCrumbs" : [{
"@class" :
"com.endeca.infront.cartridge.model.SearchBreadcrumb",
"terms" : "camera",
"removeAction" : {
"navigationState" :
"?Nr=AND%28product.priceListPair%3AsalePrices_listPrices%
2Cproduct.language%3Aen%29&Nrpp=12&Ntl=en&language=en&
searchType=simple&visitId=null&visitorId=null",
"contentPath" : "/guidedsearch",
"@class" :
"com.endeca.infront.cartridge.model.NavigationAction",
"siteRootPath" : "/pages/Default/services",
"siteState" : {
"contentPath" : null,
"siteId" : "@error:siteNotFound",
"@class" :
"com.endeca.infront.site.model.SiteState",
"siteDisplayName" : null,
"validSite" : false,
"properties" : {},
"siteDefinition" : null,
"matchedUrlPattern" : null
},
"label" : null
},
"correctedTerms" : null,
"key" : "All",
"matchMode" : "allpartial"
}
],
"rangeFilterCrumbs" : []
}
When the search has failed, the searchResults
object contains details about the error, including:
message
: The runtime error message that indicates that the search has failed.status
: Any HTTP status codes associated with the failed request.-
errorCode
: An Commerce error code, which may beGET_SEARCH_INTERNAL_ERROR = 31040, SEARCH_ADMIN_INTERNAL_ERROR = 31041, or SEARCH_ADMIN_INDEXING_INTERNAL_ERROR = 31042.
For example:
{
"message":"Unable to perform a search at this time",
"status":"500",
"errorCode":"31040"
}
message
: The second argument returned for the
SEARCH_RESULTS_UPDATED
topic contains a JSON array that
includes either a success or failure message and the
SearchViewModel
object, for example:
[{
message: "success",
requestor: SearchViewModel
}]
In the case of a failed search, this message property has a value of fail.
[{"message":"fail"}]
Memory enabled
Yes
SKU_SELECTED
A message is published to this topic when a shopper selects all the variant options for a product, thereby identifying a specific SKU.
$.Topic(pubsub.topicNames.SKU_SELECTED).publish(product, selectedSku, variantOptions);
Arguments
product
: The current ProductViewModel
.
See the View Model JSDoc for Commerce for details on what this view model contains.
selectedSku
: A JSON object that includes data for the selected SKU,
for example:
selectedSku = {
"salePrices" : null,
"resolution" : "14.1-megapixels",
"listPrice" : 399.99,
"quantity" : 5,
"repositoryId" : "camerasku_1_18",
"color" : "Black",
"dynamicPropertyMapLong" : {
"sku-camera_resolution" : 0,
"sku-camera_color" : 8
},
"salePrice" : 399.99,
"salePriceStartDate" : null,
"fractionalQuantitiesAllowed" : false
}
variantOptions
: An array whose items reflect the variant options (such as color, size, finish, resolution, and so on) that can be selected for the SKU, along with any currently selected variant options. For example, the following JSON sample shows the color
and resolution
variants returned for the camera selected above.
[
{
"optionDisplayName" : "color",
"parent" : {
"basePath" : "/",
"deferredInit" : {},
"prevHistoryLength" : 7,
"newHistoryLength" : 8,
"localeSubscription" : {
"R" : true
},
"WIDGET_ID" : "productDetails",
"imgMetadata" : [{}
],
"firstTimeRender" : true
},
"optionId" : "sku-camera_color",
"actualOptionId" : "color",
"optionCaption" : "Select color ...",
"selectedOptionValue" : {
"key" : "Antique Brass",
"value" : 0
},
"originalOptionValues":[
{
"key" : "Antique Brass",
"value" : 0
},
{
"key" : "Apricot",
"value" : 1
},
{
"key" : "Aquamarine",
"value" : 2
},
]
},
{
"optionDisplayName" : "resolution",
"parent" : {
"basePath" : "/",
"deferredInit" : {},
"prevHistoryLength" : 7,
"newHistoryLength" : 8,
"localeSubscription" : {
"R" : true
},
"WIDGET_ID" : "productDetails",
"imgMetadata" : [{}
],
"firstTimeRender" : true
},
"optionId" : "sku-camera_resolution",
"actualOptionId" : "resolution",
"optionCaption" : "Select resolution ...",
"selectedOptionValue" : {
"key" : "14.1-megapixels",
"value" : 0
},
"originalOptionValues":[
{
"key" : "14.1-megapixels",
"value" : 0
},
{
"key" : "24.3-megapixels",
"value" : 1
},
]
}
]
Memory enabled
No
USER_LOGIN_SUCCESSFUL
A message is published to this topic when the shopper has successfully logged in. You can subscribe to this topic to introduce logic that is specific to logged-in shoppers.
$.Topic(pubSub.topicNames.USER_LOGIN_SUCCESSFUL).publish();
Arguments
None
Memory enabled
No
USER_LOGOUT_SUCCESSFUL
A message is published to this topic when the shopper successfully logs out.
$.Topic(pubSub.topicNames.USER_LOGOUT_SUCCESSFUL).publish(message);
Arguments
message
: A JSON array that includes a message
property whose value is success
.
[{"message":" success "}]
Memory enabled
No
USER_PASSWORD_EXPIRED
A message is published to this topic when the user password expires.
$.Topic(pubSub.topicNames.USER_PASSWORD_EXPIRED).publish();
Arguments
None
Memory enabled
No
USER_PROFILE_UPDATE_SUCCESSFUL
A message is published to this topic when the shopper’s profile is updated successfully with a new address, email, or name.
$.Topic(pubSub.topicNames.USER_PROFILE_UPDATE_SUCCESSFUL).publish(profileData);
Arguments
profileData
: A JSON object that contains the updated user profile
data, for example:
{
"receiveEmail" : "yes",
"lastName" : "Spencers",
"locale" : "en_US",
"contactBillingAddress" : "Address Object",
"links" : [{
"rel" : "self",
"href" : http://localhost:9080/ccstore/v1/profiles/current
}
],
"contactShippingAddress" : "Address Object",
"repositoryId" : "se-570032",
"parentOrganization" : null,
"id" : "se-570032",
"dynamicProperties" : [],
"email" : "mspens@abc.com",
"shippingAddresses" : ["Address Object1","Address Object2"],
"daytimeTelephoneNumber" : null,
"secondaryAddresses" : {
"Mom' s house" : "Address Object",
"Work" : "Address Object",
"Home" : "Address Object",
},
"firstName" : "Mark",
"shippingAddress" : "Address Object"
}
Note that the Address Object
references in the example above look similar to the following:
"contactBillingAddress" : {
"lastName" : "Spencers",
"postalCode" : "36130",
"phoneNumber" : "555-555-1234",
"county" : null,
"state" : "AL",
"address1" : "123 Main St",
"address2" : null,
"firstName" : "Mark",
"companyName" : null,
"repositoryId" : "se-990032",
"city" : "Montgomery",
"country" : "US"
},
Memory enabled
Yes
USER_SESSION_EXPIRED
A message is published to this topic when the user session expires. You can subscribe to this topic to clear any session-specific data once the session expires.
$.Topic(pubsub.topicNames.USER_SESSION_EXPIRED).publish();
Arguments
None
Memory enabled
Yes