Spectrum Integration
  • Introduction
  • Ecommerce
    • Front End Integration
    • Load Design
    • Add to Cart
    • Save Design
    • Generate Cart Item
    • Pricing & Availability
    • Order Acknowledgement
    • Shipment Notification
    • Update Order Status
    • Order Search
    • Integration Driver
    • Production Related File Delivery
    • Spectrum + Shopify Integration
      • Overall Flow
      • Product Set Up: "Add-ons"
      • Line Item Properties
      • Shopify Cart
      • Order Processing
  • API
    • Environments
    • Image QueryString API
      • Image Transforms
      • Image Filters
      • Image Encoding
    • Rendering
    • WebToPrint (W2P)
    • Assets
    • Rate Limiting
  • Marketing
    • Share
  • General
    • Glossary
Powered by GitBook
On this page

Was this helpful?

  1. Ecommerce

Generate Cart Item

PreviousSave DesignNextPricing & Availability

Last updated 1 year ago

Was this helpful?

As an alternative, or supplemental, to the traditional and 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

Add to Cart
Save Design