Skip to content
msBundles
Product bundles for miniShop3 with shared pricing, discounts, and cart sync
  1. Extras
  2. msBundles
  3. Storefront
  4. msBundles.initialize snippet

msBundles.initialize

Loads storefront assets in order: msbundles.css, msbundles-helpers.js, msbundles-cart.js, msbundles.js. Before the scripts it outputs window.msbundlesConfig and window.msbundlesLexicon.

No parameters. Call it in <head> on pages with bundle cards and the cart. Without it, add buttons and styles do not work.

Example

fenom
{'!msBundles.initialize' | snippet}
modx
[[!msBundles.initialize]]

Config

KeyDefaultPurpose
autoBindtrueAuto-bind handlers after load
apiBaseUrl''API prefix if the miniShop3 router is not on the default path
maxBundleQuantityfrom setting“Bundles” field limit
calculateDebounceMs350Pause before price recalculation while typing qty
confirmRemoveBundlefalseDialog before “Remove bundle”. Off by default, like a miniShop3 product

Set a custom config before the snippet call. The snippet merges it with Object.assign:

html
<script>window.msbundlesConfig = { confirmRemoveBundle: true };</script>

Cart, data attributes, and theme notes: Frontend. Cards: msBundles.