Skip to content
Commerce Boilerplate

Blocks reference

This reference provides technical details for all Commerce blocks included in the boilerplate. Each block integrates one or more drop-in components to provide complete Commerce functionality.

The Merchant topic column links to merchant-facing documentation when you need the block title authors use in documents. The Block column links to the GitHub source folder.

BlockMerchant topicPrimary Drop-insKey Features
Shopping Experience
Product List Page Product List Pagestorefront-product-discovery, tools, storefront-wishlist, storefront-requisition-list, storefront-cartSearch, filtering, sorting, pagination, wishlist integration
Product Details Product Detailstools, storefront-pdp, storefront-wishlist, storefront-requisition-listProduct options, pricing, add to cart, wishlist toggle
Product Recommendations Product Recommendationstools, storefront-cart, storefront-recommendations, storefront-wishlistAI-powered recommendations, multiple page types
Cart Commerce Carttools, storefront-cart, storefront-wishlist, storefront-quote-managementItem management, coupon codes, gift options, move to wishlist
Mini Cart Commerce Mini Cartstorefront-cart, toolsDropdown cart summary, quick view, checkout navigation
Checkout Commerce Checkouttools, storefront-order, storefront-checkoutComplete checkout flow, shipping, payment, order review
Customer Account
Login Commerce Loginstorefront-authEmail/password authentication, redirect handling
Create Account Commerce Create Accountstorefront-authRegistration form, validation, account creation
Confirm Account Commerce Confirm Accountstorefront-auth, toolsEmail confirmation landing, account activation
Forgot Password Commerce Forgot Passwordstorefront-auth, toolsPassword reset request, email trigger
Create Password Commerce Create Passwordstorefront-auth, toolsPassword reset form, token validation
Account Header Commerce Account HeadertoolsCustomer name display, logout functionality
Account Sidebar Commerce Account Sidebartools, storefront-accountAccount navigation menu, active state management
Addresses Commerce Addressesstorefront-accountAddress CRUD operations, default address management
Customer Information Commerce Customer Informationstorefront-accountProfile editing, email/name updates
Customer Details Commerce Customer Detailsstorefront-orderCustomer info display in order context
Order Management
Orders List Commerce Orders Liststorefront-account, toolsOrder history, status display, order details navigation
Search Order Commerce Search Orderstorefront-auth, storefront-order, toolsGuest order lookup, email and order number validation
Order Header Commerce Order HeadertoolsOrder number, date, status badge
Order Status Commerce Order Statusstorefront-orderDetailed status, tracking info, delivery estimates
Order Product List Commerce Order Product Liststorefront-order, storefront-cart, toolsLine items, reorder functionality, product images
Order Cost Summary Commerce Order Cost Summarystorefront-orderSubtotal, taxes, shipping, discounts, grand total
Shipping Status Commerce Shipping Statusstorefront-order, toolsShipment tracking, carrier info, delivery status
Returns & Exchanges
Returns List Commerce Returns Liststorefront-order, toolsReturn history, status tracking, return details navigation
Create Return Commerce Create Returnstorefront-order, toolsReturn request form, item selection, reason codes
Order Returns Commerce Order Returnstools, storefront-orderReturn details for specific order
Return Header Commerce Return HeadertoolsReturn number, date, status display
Gift Options
Gift Options Commerce Gift Optionsstorefront-cartGift messages, gift wrapping, gift receipt options
Wishlist
Wishlist Commerce Wishliststorefront-cart, storefront-pdp, storefront-wishlist, storefront-auth, toolsSaved items, move to cart, item management

Every Commerce block follows this initialization pattern:

  1. Server-side rendering: Edge Delivery Services transforms the document table into HTML
  2. Client-side decoration: The block’s JavaScript decorator runs via decorateBlock()
  3. Drop-in initialization: Drop-in containers are initialized with configuration and providers
  4. Rendering: Drop-in components render into the block’s DOM
  5. Event handling: Event listeners connect to the global event bus

Blocks like Login and Forgot Password simply render a single drop-in container:

export default async function decorate(block) {
const { render } = await import('@dropins/storefront-auth/containers/SignIn.js');
await render(SignInContainer, {})({});
}

Complex blocks like Cart and Checkout coordinate multiple drop-ins:

// Cart block uses cart + wishlist drop-ins
import { render as renderCart } from '@dropins/storefront-cart/containers/Cart.js';
import { render as renderWishlist } from '@dropins/storefront-wishlist/api.js';

Blocks read configuration from document authoring tables:

const config = readBlockConfig(block);
const hideHeading = config['hide-heading'] === 'true';

Blocks listen to events from drop-ins and other blocks:

events.on('cart/updated', () => {
// React to cart changes
});

All drop-ins are loaded via import maps defined in head.html:

{
"imports": {
"@dropins/storefront-cart/": "/scripts/__dropins__/storefront-cart/",
"@dropins/storefront-checkout/": "/scripts/__dropins__/storefront-checkout/"
}
}

Drop-ins require providers to be initialized in scripts/initializers/:

  • GraphQL provider: Configures Commerce backend endpoint and headers
  • Authentication provider: Manages customer sessions and tokens
  • Event provider: Sets up the global event bus

See Configuration for provider setup details.

Each block includes:

  1. Base styles: Block-specific CSS in blocks/*/block-name.css
  2. Drop-in tokens: Design tokens in scripts/initializers/dropin-name.js
  3. Global tokens: Shared tokens in scripts/initializers/

Every storefront requires these pages:

  • Homepage: Product Recommendations, Product List Page
  • Product Page (PDP): Product Details, Product Recommendations
  • Cart Page: Cart, Product Recommendations
  • Checkout Page: Checkout
  • Account Dashboard: Account Header, Account Sidebar

Enhance your storefront with:

  • Wishlist Page: Wishlist
  • Order Tracking: Search Order, Order Status, Orders List
  • Returns Portal: Create Return, Returns List, Order Returns
  • Account Management: Addresses, Customer Information

For storefront-wide guidance see Performance best practices.

Commerce blocks are lazy-loaded automatically:

  1. Blocks below the fold are loaded when scrolled into view
  2. Drop-in containers are code-split and loaded on demand
  3. Heavy dependencies (like checkout) are loaded only when needed

For optimal performance:

  1. Keep Mini Cart in header (loads early)
  2. Defer non-critical blocks below the fold
  3. Use Product Recommendations sparingly (loads ML models)
  1. Start the AEM CLI: aem up.
  2. Modify block JavaScript in blocks/commerce-*/.
  3. Observe changes hot-reload automatically.
  4. Test with demo backend or configure your own in config.json (copy from demo config or use the config generator tool ).

To create a custom Commerce block:

  1. Create a new directory: blocks/my-custom-block/
  2. Add decorator: my-custom-block.js
  3. Add styles: my-custom-block.css
  4. Import and render drop-in containers
  5. Initialize required providers

See Exploring blocks (AEM documentation) for block creation basics.

  • Block not rendering? Verify drop-in providers are initialized in scripts/initializers/
  • GraphQL errors? Check Commerce backend configuration in your config.json file
  • Styling issues? Review design token configuration in drop-in initializers
  • Event not firing? Ensure event bus is initialized and event names match documentation