Save Design

Similar to spectrumAddtoCart,Spectrum will send a recipeID, SKUs, quantities, and other relevant data to the page via the spectrumSaveDesign function. Once the recipe is saved, the design is locked, and available for recall within Spectrum for the length of the client contract.

The spectrumSaveDesign function should accept a single payload argument and use it to add items to the cart. The implementation of this call is the responsibility of the e-commerce development team. We have provided some example use cases below to show how this functionality can be useful to users.

window.spectrumSaveDesign = 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
}

Common Use Case

The most common use case for Save Design is when a user may want to design a few items and come back and order them later. In this case, the recipes are saved and 2D images may be retrieve to showcase in a "My Designs" section of their account. Using the Spectum Rendering routes, you may showcase the Saved designs on any page of your website.

It should be noted that Spectrum simply calls this JavaScript function and must be implemented to produce the correct behavior. For example:

  • Determining if the user is authenticated.

  • Redirecting to login if user is not authenticated

  • Saving the Recipe to the user's account or other data store.

Last updated