This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Umbraco Commerce Checkout is an add-on package for Umbraco Commerce that provides a ready-made, themeable, and responsive checkout flow. It is built as an ASP.NET Razor SDK project targeting .NET 8+ and Umbraco 16+.
This package follows the same versioning strategy as Umbraco Commerce and is part of the larger Umbraco Commerce ecosystem.
- .NET 10.0 SDK (see
global.jsonfor exact version) - Node.js 20+ for frontend development
- Umbraco 16.0.0 or newer
- Umbraco Commerce 17.0.0 or newer
Build the entire solution:
dotnet build Umbraco.Commerce.Checkout.sln --configuration ReleaseRestore NuGet packages (locked mode):
dotnet restore Umbraco.Commerce.Checkout.sln --locked-modeCreate NuGet package:
dotnet pack Umbraco.Commerce.Checkout.sln --configuration Release --output ./artifactsThe frontend code is located in src/Umbraco.Commerce.Checkout/Client/ and uses Vite for bundling.
Install frontend dependencies:
cd src/Umbraco.Commerce.Checkout/Client
npm ciBuild frontend (one-time):
cd src/Umbraco.Commerce.Checkout/Client
npm run buildWatch mode for development:
cd src/Umbraco.Commerce.Checkout/Client
npm run watchLint frontend code:
cd src/Umbraco.Commerce.Checkout/Client
npm run lintThe package is structured as an ASP.NET Razor SDK library with static web assets deployed to App_Plugins/UmbracoCommerceCheckout.
Key Components:
-
Composing (
Composing/)UmbracoCommerceCheckoutComposer: Auto-registers the package with Umbraco's DI container- Composes after
UmbracoCommerceComposerto ensure proper initialization order
-
Configuration (
Configuration/)UmbracoCommerceCheckoutSettings: Configurable settings bound fromappsettings.jsonunderUmbraco:Commerce:Checkout
-
Extensions (
Extensions/)- Extension methods for Umbraco and Commerce objects
CompositionExtensions: DI registration helpersCustomerExtensions: Customer data manipulationPublishedContentExtensions: Umbraco content helpers
-
Pipeline (
Pipeline/)- Install pipeline for setting up checkout nodes in Umbraco
InstallPipeline: Orchestrates installation tasksTasks/: Individual installation steps (create data types, document types, nodes, payment methods, configure stores)
-
Web Layer (
Web/)- Controllers: MVC/Surface controllers for checkout flow
UmbracoCommerceCheckoutBaseController: Base class with shared checkout logicUmbracoCommerceCheckoutCheckoutPageController: Renders checkout pagesUmbracoCommerceCheckoutCheckoutStepPageController: Handles individual step pagesUmbracoCommerceCheckoutSurfaceController: Form submission endpointsUmbracoCommerceCheckoutApiController: API endpoints for the checkout flow
- DTOs: Data transfer objects for API payloads
- Filters: Action filters like
NoStoreCacheControlAttribute
- Controllers: MVC/Surface controllers for checkout flow
-
Views (
Views/UmbracoCommerceCheckout/)- Razor views for each checkout step
- Layout:
UmbracoCommerceCheckoutLayout.cshtml - Step pages: Information, Shipping Method, Payment Method, Review, Confirmation
- Partials: Reusable view components
-
Events (
Events/)- Notification handlers for Umbraco and Commerce events
SetStoreCheckoutRelation: Links stores to checkout pagesSyncZeroValuePaymentProviderContinueUrl: Updates zero-value payment continue URLsResetPaymentAndShippingMethods: Clears cached methods on cache refresh
-
Services (
Services/)InstallService: Orchestrates the installation process
The frontend is split into two entry points built with Vite + TypeScript:
-
Backoffice (
Client/src/backoffice/)- Built as
uccheckout.backoffice.js - Umbraco backoffice integration (dashboards, modals)
- Installation API and UI for setting up checkout pages
- Uses Umbraco's Lit-based web components
- Built as
-
Surface (
Client/src/surface/)- Built as
uccheckout.surface.js+uccheckout.surface.css - Frontend checkout UI (customer-facing)
- Styled with Tailwind CSS
- Provides interactive checkout experience
- Built as
Build Output:
- Frontend builds to
src/Umbraco.Commerce.Checkout/wwwroot/ - Static assets are packaged as Razor SDK static web assets
- Assets are deployed to
App_Plugins/UmbracoCommerceCheckoutat runtime
Dependency Injection:
- Uses
AddUmbracoCommerceCheckout()extension method for registration - Registers as singleton services where appropriate
- Notification handlers registered via
AddNotificationAsyncHandler<,>()
Store-Checkout Relationship:
StoreCheckoutRelationHelpermanages relationships between Commerce stores and checkout page nodes- Content cache refresher notifications keep relationships synchronized
Zero-Value Payment:
- Package creates a special "Zero Value Payment" payment method during installation
- Used for orders with 0 total (e.g., 100% discount code applied)
- Continue URL synchronized when checkout pages are published/unpublished
Install Pipeline:
- Extensible pipeline pattern for installation tasks
- Tasks run in sequence: Data Types → Document Types → Nodes → Payment Method → Store Configuration
- Each task is a separate class implementing
IAsyncPipelineTask<InstallPipelineData>
Umbraco.Commerce.Checkout.vLatest/
├── src/
│ └── Umbraco.Commerce.Checkout/ # Main package project
│ ├── Client/ # Frontend code (TypeScript/Vite)
│ │ ├── src/
│ │ │ ├── backoffice/ # Backoffice UI
│ │ │ └── surface/ # Frontend checkout UI
│ │ ├── package.json
│ │ ├── vite.config.js
│ │ └── tailwind.config.js
│ ├── Composing/ # DI composition
│ ├── Configuration/ # Settings
│ ├── Events/ # Event handlers
│ ├── Extensions/ # Extension methods
│ ├── Helpers/ # Helper classes
│ ├── Models/ # Domain models
│ ├── Pipeline/ # Install pipeline
│ │ └── Tasks/ # Install tasks
│ ├── Services/ # Application services
│ ├── Views/
│ │ └── UmbracoCommerceCheckout/ # Razor views
│ ├── Web/ # Web layer
│ │ ├── Controllers/ # MVC controllers
│ │ └── Dtos/ # API DTOs
│ └── wwwroot/ # Static assets (built from Client/)
├── demos/
│ └── v16-blendid/ # Demo store project
│ ├── Umbraco.Commerce.DemoStore/ # Demo store library
│ └── Umbraco.Commerce.DemoStore.Web/ # Demo web project
├── Directory.Build.props # Shared MSBuild properties
├── Directory.Packages.props # Central package management
├── version.json # GitVersioning configuration
└── azure-pipelines.yml # CI/CD pipeline
- Version File:
version.json(Nerdbank.GitVersioning) - Version Pattern: Matches Umbraco Commerce major version
- Package Dependencies: Defined in
Directory.Packages.propswith version ranges
Important: When updating version numbers, ensure:
- Update
version.json(NerdBank.GitVersioning controls assembly/NuGet versions) - Update
Client/package.jsonto match - Dependency ranges in
Directory.Packages.propsreference the correct Umbraco Commerce version range
- Navigate to Client directory:
cd src/Umbraco.Commerce.Checkout/Client - Ensure dependencies are installed:
npm ci - Run watch mode:
npm run watch - Make changes to TypeScript files in
src/backoffice/orsrc/surface/ - Vite will rebuild automatically to
wwwroot/
- Modify C# files in appropriate directories
- Build solution:
dotnet build Umbraco.Commerce.Checkout.sln - If views changed, they are copied automatically during build
- Test using the demo store
- Create new task class in
Pipeline/Tasks/ - Implement
IAsyncPipelineTask<InstallPipelineData> - Register in
Extensions/CompositionExtensions.csviaAddUmbracoCommerceInstallPipeline() - Task will execute during package installation
- Backwards Compatibility: All development should prioritize backwards compatibility to minimize breaking changes
- Target Frameworks: Multi-target .NET 8, 9, and 10 (check
.csprojfor current targets) - Umbraco Version: Targets Umbraco 17.x (beta currently)
- Commerce Version: Requires Umbraco Commerce 17.x
The Azure DevOps pipeline (azure-pipelines.yml) triggers on:
- Branch pushes:
dev,release/*,hotfix/*,support/*,feature/* - Tags:
release-*
Pipeline Steps:
- Restore NPM packages (with caching)
- Build frontend (
npm run build) - Restore NuGet packages (with optional caching)
- Build solution (
dotnet build) - Pack solution (
dotnet pack) - Publish artifacts (nupkg and build output)