---
title: Overview
date: 2026-07-02T14:41:00+01:00
author: John Henry Donovan
canonical_url: "https://johnhenry.ie/plugins/bundle-builder/docs/api-reference/overview"
section: Plugins
---
esc

↑↓ to navigate↵ to selectesc to close

Menu On this page 

- [Return to top](#)

Documentation

Documentation

# Overview

The plugin's namespace is `johnhenry\bundlebuilder`. Access the plugin instance via `BundleBuilder::getInstance()`.

## Element

### `elements\Bundle`

A purchasable element (extends `craft\commerce\base\Purchasable`).

```php
use johnhenry\bundlebuilder\elements\Bundle;

$bundles = Bundle::find()->type('bundles')->all();
```

Notable members:

MemberDescription`getType(): BundleType`The bundle's type.`getProducts(): BundleProduct[]`The bundle's components (product + qty).`getIsAvailable(): bool`Post/expiry window + component stock check.`populateLineItem(LineItem)`Resolves chosen variants, writes options + snapshot, validates stock.`afterOrderComplete(Order, LineItem)`Decrements component variant inventory.`getTaxCategoryId(): int`Returns the apportioned category for multiple supply bundles.

### `<strong>elements\db\BundleQuery</strong>`

Adds `type()`, `typeId()`, `postDate()` and `expiryDate()` params on top of the standard purchasable query.

## Models

- `models\BundleType`: a bundle type (field layout, formats, site settings, preview targets, tax treatment).
- `models\BundleTypeSite`: per-site URL settings.
- `models\BundleProduct`: a component (productId, qty, sortOrder).

## Enums

- `enums\PricingStrategy`: `Fixed`, `Automatic`.
- `enums\DiscountType`: `Percentage`, `Flat`.
- `enums\TaxTreatment`: `Composite`, `Multiple`.

## Twig variable

`craft.bundleBuilder` → `variables\BundleBuilderVariable` (`bundles()`, `getBundlesForProduct()`).

See [Services](https://johnhenry.ie/plugins/bundle-builder/docs/api-reference/services) for the service layer.

On this page
