Add to Cart

Spectrum will send SKUs, quantities, and other relevant data to the cart via the spectrumAddToCart function. This function should accept a single payload argument and use it to add items to the cart.

window.spectrumAddToCart = function(payload) {
  // 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
}

The return value should be a Promise.

Last updated