SXA Storefront shared events

Current version: 10.3

SXA Storefront uses the following shared events:

Event

Description

Actions

CXAEvent.ClearMessage

Requests the Message Summary rendering to remove messages that are displayed.

Listening

  • Message Summary

Emitting

  • Add to Cart

  • Checkout Billing

  • Checkout Review

  • Cart Lines

  • Product Bundle

  • Product Variant

CXAEvent.SendMessage

Requests the Message Summary rendering to display the message.

Event argument:

RequestResponse
{
  type:
CXAMessageType,
  message: String
}

CXAMessageType enum:

  • Info

  • Error

  • Warning

Listening

  • Message Summary

Emitting

  • Product Bundle

  • Product Inventory

  • Product Variant

CXAEvent.CartUpdated

Emits the event when the latest cart is received. This event is emitted by the CXACartContext whenever the object received by the context is of type CartJsonResult.

Listening

  • Free Gift Selections

  • Cart Lines

  • Minicart

  • Cart Promotion

  • Cart Total

Emitting

  • Free Gift Selection

  • Cart Lines

  • Minicart

  • CXACartContext

CXAEvent.SetPrice

Requests the Product Price rendering to display the price of the current product variant or product bundle selection.

Event argument:

RequestResponse
{
  productId: String,
  listPrice: Number,
  adjustedPrice:
Number,
  isOnSale: Boolean,
  savingsMessage:
String
}

Listening

  • Product Price

Emitting

  • Product Bundle

  • Product Variant

CXAEvent.SelectedProduct

Emits an event when a product variant is selected.

RequestResponse
Event argument:
{
  CurrentCatalogName:
String,
  CurrentProductId:
String,
  CurrentVariantId:
String
}

Listening

  • Add to Cart

  • Product Inventory

Emitting

  • Product Variant

CXAEvent.SelectedBundleProduct

Emits an event when a product bundle is selected.

Event argument:

RequestResponse
{
  bundleSelection:
BundleSelection
}

Listening

  • Add to Cart

  • Product Inventory

Emitting

  • Product Bundle

CXAEvent.SelectedProductValid

Emits the event to indicate that the current product selection is valid so that the Add to Cart component can enable the Add to Cart button.

Listening

  • Add to Cart

Emitting

  • Product Bundle

  • Product Inventory

  • Product Variant

CXAEvent.SelectedProductInvalid

Emits the event to indicate that the current product selection is valid so that the Add to Cart component can disable the Add to Cart button.

Listening

  • Add to Cart

Emitting

  • Product Bundle

  • Product Inventory

  • Product Variant

CXAEvent.BundleStockStatusValid

Emits the event to indicate that the current bundle selection’s stock status is valid so that the Product Bundle can then request for the Bundle Selection’s price.

Event argument:

RequestResponse
{
  productId: String
}

Listening

  • Product Bundle

Emitting

  • Product Inventory

CXAEvent.GetStockInfo

Product Inventory component emits this event when the response is received from the API endpoint Catalog/GetCurrentProductStockInfo.

Event argument:

RequestResponse
{
  productId: String,
  stockInfos: Array
}

Listening

  • Product Bundle

Emitting

  • Product Inventory

CXAEvent.DiscountApplied

CXACartContext emits the event after calling to the API endpoint Cart/ApplyDiscount.

Listening

  • Cart Lines

  • Cart Promotion

  • Cart Total

Emitting

  • CXACartContext

CXAEvent.DiscountRemoved

CXACartContext emits the event after calling to the API endpoint Cart/RemoveDiscount.

Listening

  • Cart Lines

  • Cart Promotion

  • Cart Total

Emitting

  • CXACartContext

Do you have some feedback for us?

If you have suggestions for improving this article,