Spartacus JavaScript Storefront

website·Indexed 30 days ago

https://gladius-mtl.github.io/spartacus-docs/3.x/

Documentation for Spartacus, a decoupled JavaScript storefront for SAP Commerce Cloud. Covers installation via schematics, server-side rendering (SSR), PWA support, and integration with tools like Yotpo, Qualtrics, and SmartEdit. Includes guides on component configuration (Searchbox, Pagination), SEO, HTTP error handling, and upgrading to version 2.0.

Tokens
206.4K
Snippets
862
Records
1.5K
Agent score
71%

What's inside Spartacus

  1. Overview of Progressive Web Application (PWA) support in Spartacus

    Spartacus allows developers to add Progressive Web Application (PWA) support to their applications. This includes the ability to display a banner prompt that encourages users to install the Spartacus app on their mobile or desktop devices.
  2. Overview of Spartacus Storefront Page and Area Features

    Spartacus provides a set of pre-built storefront areas and pages to handle common e-commerce workflows. Key areas include:

    • Header: Contains language/currency selection, help links, logo, search box, cart icon, category bar, and breadcrumbs.
    • Footer: Contains company links and copyright notices.
    • Home: Driven by CMS page layout and slots.
    • Search: Header search box provides product suggestions; results include backend-provided facets.
    • Categories: Header menus support up to 2 levels of categories with backend-provided facets.
    • Product Details: Displays title, images, price, quantity, stock, and summary. Supplementary areas include specifications, reviews, and shipping info.
    • Added-to-cart Modal: Confirms product addition and allows quantity adjustments.
    • Authentication: Handles registration, login, and password recovery.
    • Cart Page: Lists items and purchase summary; supports quantity changes and item removal.
    • Checkout: A four-step process (Shipping/Payment details $\rightarrow$ Shipping Method $\rightarrow$ Review $\rightarrow$ Submission). It automatically saves new addresses/payment methods and is fully extendable or replaceable on a per-step basis.
    • Order History: Lists orders by consignment and provides specific order details.
    • Address Management: Allows users to add, edit, delete, and set default shipping addresses.
    • Payment Method Management: Allows users to delete and set default payment methods.
    • Account Settings: Allows editing of name, email, password, consent preferences, and account closure requests.
    • Add to Home (PWA): Enables users to add the storefront web app to their device home/launch screen as a Progressive Web App.
  3. Overview of Structured Data in Spartacus

    Introduced in version 1.3, Spartacus uses Structured Data to make web content more understandable for crawlers (e.g., Google, Pinterest, Twitter) by aligning with schema.org standards. Spartacus specifically implements JSON-LD, which is the Google-recommended format because it is decoupled from UI components and easier to generate than RDFa or Microdata. To optimize performance, schemas are primarily generated during the Server Side Rendering (SSR) process, though they remain visible in development mode for debugging.
  4. Overview of Configurable Routing in Spartacus

    Spartacus uses the Angular Router to handle navigation and URL interception in its single-page application architecture. While Spartacus provides default routing that works out-of-the-box, every route is configurable. This allows developers to customize URLs to improve SEO, usability, and enable deep-linking into specific application states.
  5. Overview of Spartacus HTTP Error Handling

    Spartacus uses an HTTP interceptor to evaluate error responses from the back end. It matches the HTTP status code of the response against a set of registered error handlers and executes the first matching handler. If no specific handler is found, the UNKNOWN handler is used. Custom handlers can be added or existing ones overridden using the Angular dependency injection (DI) system.
  6. Overview of Structured Data in Spartacus

    Introduced in version 1.3, Spartacus uses Structured Data to make web content more understandable for crawlers (e.g., Google, Pinterest, Twitter) by aligning with schema.org standards. Spartacus specifically implements JSON-LD as the vocabulary because it is recommended by Google and is decoupled from UI components. The generation of these schemas is limited to the Server Side Rendering (SSR) process and development mode to optimize performance for end users.
  7. Overview of the Spartacus Store Locator

    The Store Locator feature (introduced in Spartacus v1.2) allows customers to find brick-and-mortar retail locations. It supports three primary discovery methods: using the device's current location (sorted by distance), viewing all stores (sorted by country), or searching via address, town, or postal code. Users can view store details (address, phone, hours) and get directions via Google Maps.
  8. Overview of Spartacus JavaScript Storefront

    Spartacus is a lean, Angular-based JavaScript storefront designed for SAP Commerce Cloud. It operates as a decoupled frontend that communicates with the SAP Commerce Cloud backend exclusively through the Commerce REST API. It is designed to be a Progressive Web Application (PWA) and is open source.
  9. Overview of Spartacus Customer Interests feature

    Introduced in Spartacus version 1.4, the Customer Interests feature provides a dedicated page within the user account section. This allows customers to view and manage their registered product interests, remove interests, and update their notification receiving channels.
  10. Overview of Assisted Service Module (ASM) in Spartacus

    The Assisted Service Module (ASM) allows customer service personnel to provide real-time sales and service support by emulating a customer's experience through the Spartacus storefront. This feature was introduced in Spartacus version 1.3.
  11. Overview of SAP Commerce Cloud (Project Spartacus)

    Spartacus is an open-source JavaScript web application built with Angular and published as libraries. It allows developers to create branded, decoupled storefronts for SAP Commerce Cloud. The recommended usage pattern is to build a custom JavaScript web application and import the Spartacus libraries. It is designed to be customizable, extendable, and upgradable.
  12. Overview of the spartacussampledataaddon AddOn

    The spartacussampledataaddon AddOn creates new WCMS base sites (electronics-spa, apparel-spa, and powertools-spa) that share the same product catalog as the default sample sites but use content catalogs modified specifically for Spartacus.

    When installed, the AddOn performs the following actions via the SpaSampleAddOnSampleDataImportService:

    1. Creates new base sites (if configured in extensions.xml).
    2. Creates new ContentCatalog and catalogVersions (Staged and Online).
    3. Sets up a CatalogVersionSyncJob to sync the standard sample store content catalog to the -spa version.
    4. Performs cleaning of unused Accelerator pages/slots.
    5. Imports Spartacus-specific content via ImpEx.
    6. Synchronizes the spaContentCatalog:staged to :online and grants permissions to the cmsmanager.
    7. Imports email data.