For the complete documentation index, see llms.txt. This page is also available as Markdown.

Generate Cart Item

As an alternative, or supplemental, to the traditional Add to Cart and Save Design methods, Spectrum can generate the payload data for a cart item.

An e-commerce system can call the following method, provided by Spectrum on the window object:

window.spectrumGenerateCartItem() // returns a promise

Which will trigger Spectrum to return the payload data via a native promise.

  // payload.recipeSetId: string
  // payload.items: array | null
  // payload.items[n]: object
  // payload.items[n].sku: string | null
  // payload.items[n].name: string | null
  // payload.items[n].quantity: number | null
  // payload.primaryThumbnailAngle: string | null
  // payload.thumbnailsByAngle: array | null
  // payload.thumbnailsByAngle[n].angleName: string
  // payload.thumbnailsByAngle[n].url: string
  // payload.options: object | null
  // payload.options[optionName]: string

Last updated

Was this helpful?