For the complete documentation index, see llms.txt. This page is also available as Markdown.

MOB SDK

window.eliteBundle.sdk.mob — live Multi-Option Bundle state and actions, updated on every React render.

Available after the elite:mob:ready event fires. null when no MOB bundle is on the current page.


Option modes

MOB supports two option modes, set per-option in the admin:

Mode
Behavior

"products"

Customer picks from a flat list of product/variant combos. Use selectableItems + selectItem.

"single_product_options"

Customer picks Shopify option values (size, color…) for a single product. Use optionSelections + setOptionSelection.

Most options use "products" mode. Read options[i].optionMode to determine which applies.


State

bundleId

string

Shopify product ID of the bundle.


options

BundleStep[]

The configured bundle options from the admin. Each option has title, optionMode, and product GID references.


optionProducts

Product[][]

Fetched Shopify products indexed by option: optionProducts[optionIndex][productIndex].


selectableItems

MobSelectableItem[][]

Flat list of selectable product/variant combos per option (products mode only).

Example:


selectedItemKeys

Record<number, string | null>

Currently selected item key per option (products mode). { [optionIndex]: itemKey | null }. null means nothing selected yet.


optionSelections

Record<number, Record<string, string>>

Selected Shopify option values per option (single_product_options mode). { [optionIndex]: { [optionName]: selectedValue } }.


selectedVariants

(ProductVariant | null)[]

Resolved variant for each option. null if that option has no valid selection yet.


totalPrice

number

Sum of all selected variant prices. 0 when nothing is selected. Rounded to 2 decimal places.


totalPriceFormatted

string

totalPrice formatted using the store's money format, e.g. "$59.99". Use this for display.


discountedPrice

number | null

Price after the bundle discount is applied. null when no discount is active.


discountedPriceFormatted

string | null

discountedPrice formatted for display, e.g. "$49.99". null when no discount is active.


discountPercent

number

The active discount percentage. 0 when no discount applies.


currencyCode

string

ISO 4217 currency code from the first fetched product, e.g. "USD".


allSelected

boolean

true when every option has a valid selection. Gate your add-to-cart button on this.


allSelectedVariantsAvailable

boolean

true when all selected variants are available for purchase. A variant may be selected but out of stock.


isAddingToCart

boolean

true while the cart POST request is in flight. Show a loading spinner on your add-to-cart button.


addToCartError

string | null

Non-null when the last add-to-cart attempt failed.


isLoading

boolean

true while products are being fetched from the Storefront API.


error

string | null

Non-null when product fetching failed.


discountConfig

DiscountSettings

The discount configuration for this bundle.


Actions

formatPrice(amount)

Formats a monetary amount using the store's money format and active currency rate.


selectItem(optionIndex, itemKey)

Selects a product/variant combo for an option (products mode). Replaces any previous selection for that option.


setOptionSelection(optionIndex, optionName, value)

Sets a Shopify option value for an option (single_product_options mode). Call once per Shopify option name.


addToCart(redirectTarget?)

Adds all selected variants to cart as a bundle. Only call when allSelected is true.

redirectTarget

Behavior

"checkout" (default)

Redirects to Shopify checkout

"cart"

Redirects to /cart

"stay_on_page"

No redirect


Full example

Last updated

Was this helpful?