Next Commerce
Bundle SelectorReference

Attributes

Container Attributes

Core

AttributeDescription
data-next-bundle-selectorMarks the container; required to activate the enhancer
data-next-selection-modeswap (default) or select. swap writes to cart immediately on card click; select only tracks selection — use with an external add-to-cart button
data-next-selector-idUnique ID for this selector instance; used by data-next-bundle-slots-for elements and external enhancers (e.g. AddToCartEnhancer) to reference this selector
data-next-include-shippingtrue / false — include shipping in price totals shown via display elements

Auto-render templates

AttributeDescription
data-next-bundlesJSON array of bundle definitions; renders one card per entry when a card template is also set
data-next-bundle-template-idID of an element whose innerHTML is the card template
data-next-bundle-templateInline card template (alternative to data-next-bundle-template-id)
data-next-bundle-slot-template-idID of an element whose innerHTML is rendered once per bundle item slot
data-next-bundle-slot-templateInline slot template (alternative to data-next-bundle-slot-template-id)
data-next-variant-option-template-idID of an element whose innerHTML is a single variant option; replaces the default <select>
data-next-variant-selector-template-idID of an element whose innerHTML wraps a variant attribute group; option elements are injected into [data-next-variant-options] inside it

CSS class overrides

AttributeDefault class overridden
data-next-class-bundle-cardnext-bundle-card
data-next-class-selectednext-selected
data-next-class-in-cartnext-in-cart
data-next-class-variant-selectednext-variant-selected
data-next-class-variant-unavailablenext-variant-unavailable
data-next-class-bundle-slotnext-bundle-slot
data-next-class-slot-variant-groupnext-slot-variant-group

Bundle Card Attributes

AttributeDescription
data-next-bundle-cardMarks an element as a selectable bundle card
data-next-bundle-idUnique string identifier for this bundle (required)
data-next-bundle-nameHuman-readable display name; exposed as bundle.{id}.name in display elements
data-next-bundle-itemsJSON array of { packageId, quantity, configurable?, noSlot? }
data-next-bundle-vouchersComma-separated or JSON array of coupon codes applied when this bundle is selected
data-next-selected="true"Pre-selects this card on init

Bundle Item Fields

FieldTypeDescription
packageIdnumberCampaign package ref_id
quantitynumberQuantity to add to cart
configurablebooleanWhen true and quantity > 1, expands the item into individual per-unit slots each with their own variant selectors
noSlotbooleanWhen true, no slot row is rendered for this item (useful for silent add-ons like free gifts)

Slot Placeholder

AttributeDescription
data-next-bundle-slotsPlaceholder element inside a bundle card where slot rows are injected. Required when data-next-bundle-slot-template-id is configured. Its content is replaced on every cart update. Do not attach event listeners to its children — they are destroyed on re-render

External Slots Container

AttributeDescription
data-next-bundle-slots-forRenders the selected bundle's slot rows into an element outside the selector container. Value must match data-next-selector-id on the container. See Slot Templates

Display System Integration

Use data-next-display="bundle.{selectorId}.{property}" on any element in the document to bind it to the currently selected bundle's state. {selectorId} must match data-next-selector-id on the container. Without data-next-selector-id, external display elements will not update.

Supported properties:

PropertyFormatDescription
pricecurrencyTotal price after all discounts
originalPricecurrencyTotal price before discounts
discountAmountcurrencyTotal discount applied to the bundle
discountPercentagepercentageDiscount as a percentage of the original price
unitPricecurrencyTotal price after discounts divided by total visible slot quantity
originalUnitPricecurrencyTotal price before discounts divided by total visible slot quantity
hasDiscountbooleantrue when a discount is applied
isSelectedbooleantrue when this bundle card is currently selected
nametextValue of data-next-bundle-name on the card element

Deprecated properties (still supported for backwards compatibility):

PropertyUse instead
compareoriginalPrice
savingsdiscountAmount
savingsPercentagediscountPercentage
hasSavingshasDiscount

Supports all standard display modifiers: data-next-format, data-hide-if-zero, data-hide-if-false.


Display Attributes

data-next-bundle-display — place on elements inside a bundle card. The formatted value is written after each price fetch.

FieldFormatDescription
pricecurrencyTotal price after all discounts
originalPricecurrencyTotal price before discounts
discountAmountcurrencyTotal discount
unitPricecurrencyTotal price divided by total visible quantity
originalUnitPricecurrencyOriginal price divided by total visible quantity
discountPercentagepercentageDiscount as a percentage of the original price
hasDiscountbooleanElement shown when a discount is applied; hidden otherwise
isSelectedbooleanElement shown when this bundle card is selected; hidden otherwise
nametextValue of data-next-bundle-name

data-next-bundle-price (deprecated) — use data-next-bundle-display instead.


Attributes Set by the Enhancer on Variant Option Elements

When using a custom variant option template (data-next-variant-option-template-id), the enhancer sets these attributes on each rendered option element:

AttributeDescription
data-next-variant-optionAttribute code this option controls (e.g. color)
data-next-variant-valueOption value this element represents (e.g. red)

On this page