Umbraco Commerce
CMSCloudHeartcoreDXP
10.latest (LTS)
10.latest (LTS)
  • Umbraco Commerce Documentation
  • Release Notes
  • Commerce Products
    • Commerce Packages
    • Commerce Payment Providers
    • Commerce Shipping Providers
  • Installation
    • Installing Umbraco Commerce
    • Licensing
  • Upgrading
    • Upgrading Umbraco Commerce
    • Version Specific Upgrade Notes
    • Migrate from Vendr to Umbraco Commerce
      • Migrate Umbraco Commerce Checkout
      • Migrate custom Payment Providers
  • Getting Started
    • Introduction
    • Umbraco Configuration
    • User Interface
  • How-To Guides
    • Overview
    • Configure SQLite support
    • Limit Order Line Quantity
    • Use an Alternative Database for Umbraco Commerce Tables
  • Key Concepts
    • Get to know the main features
    • Base Currency
    • Bulk Actions
    • Calculators
    • Dependency Injection
    • Discount Rules / Rewards
    • Events
    • Fluent API
    • Order Calculation State
    • Payment Forms
    • Payment Providers
    • Pipelines
    • Price/Amount Adjustments
    • Price Freezing
    • Product Adapters
    • Product Bundles
    • Product Variants
      • Complex Variants
    • Properties
    • ReadOnly and Writable Entities
    • Search Specifications
    • Settings Objects
    • Tax Sources
    • UI Config Files
    • Umbraco Properties
    • Unit of Work
    • Umbraco Commerce Builder
  • Tutorials
    • Overview
  • Reference
    • Go behind the scenes
Powered by GitBook
On this page
  • Creating a Bundle
  • Adding Sub Products to a Bundle
  • Order Line Price Calculation
  • Displaying Bundles in the Back-Office

Was this helpful?

Edit on GitHub
Export as PDF
  1. Key Concepts

Product Bundles

Creating bundles of products with Umbraco Commerce.

Occasionally you may need to create a product with multiple sub-products. A good example of this is when buying a computer where you may pick the computer as the main product. You can then choose the different components to make up the computer, such as the hard disk options. The final order line then becomes the composite order line of the selected primary product and all its sub-product options. To achieve this kind of configurable product in Umbraco Commerce, we can use a feature called product bundling.

Creating a Bundle

To create a bundle, we first add the primary product to an order as we normally would. In addition to the product/quantity information, we also provide a unique bundleId to identify that adding this product should create a bundle order line.

// Define a unique bundle id for the order line
var bundleId = "MyUniqueBundleId";

// Add the primary product to the order giving it a bundle ID
order.AddProduct(productReference, productQuantity, bundleId);

Adding Sub Products to a Bundle

With the primary product added as a bundle, we can then add sub-products to that bundle by calling one of the AddProductToBundle order methods.

// Define a unique bundle id for the order line
var bundleId = "MyUniqueBundleId";

// Add the primary product to the order giving it a bundle ID
order.AddProduct(productReference, productQuantity, bundleId);

// Add a sub product to the bundle by calling a AddProductToBundle method
// passing in the same bundle ID as the primary order line
order.AddProductToBundle(bundleId, subProductReference, subProductQuantity);

Order Line Price Calculation

By adding sub-products to a bundle, Umbraco Commerce knows to automatically sum up all the sub-product prices together. It will then add them to the unit price of the primary order line for you. This means that there is nothing extra you need to do in the calculation process.

Displaying Bundles in the Back-Office

As you can imagine, product bundles could get rather large making it a little difficult to display them in the backoffice. Umbraco Commerce bundles order lines together in a collapsible user interface. This gives you a clear view of your orders whilst still being able to drill into the detail of the items purchased.

PreviousProduct AdaptersNextProduct Variants

Last updated 1 year ago

Was this helpful?

Product bundles in the backoffice