msBundles
Product bundles for miniShop3 with shared pricing, discounts, and cart sync

Renders HTML for product bundles. Put it in the product template or anywhere you need set cards.
bundle > 0 — one bundle by ID. Inactive with activeOnly=1, or a context_key that does not match the current request context → empty.bundles — bundles by ID list (order as in the parameter). IDs from another context are skipped.list=all — all bundles in the current context (by sortorder).product > 0 — bundles that include the product in the current context.emptyTpl.With msbundles_stock_behavior=hide and unavailable required stock, the card is omitted. block and message keep the card with --blocked / --warning modifiers.
With no bundle image and imageFallback=1, the first product thumb is used.
| Parameter | Default | Description |
|---|---|---|
product | 0 | Product resource ID. Bundles that include it in the current context |
bundle | 0 | Single bundle ID (instead of product) |
bundles | — | Comma-separated IDs: 5,8,12 |
list | — | all — all bundles in the current context (by sortorder) |
tpl | tplMsBundlesItem | Card chunk |
wrapperTpl | tplMsBundlesList | List wrapper |
emptyTpl | tplMsBundlesEmpty | Empty result |
productTpl | tplMsBundlesProduct | Composition line chunk |
imageFallback | 0 | No bundle image → first product thumb |
activeOnly | 1 | Active bundles only |
quantity | 1 | Bundle count for price and stock |
toPlaceholder | — | Placeholder name. Snippet returns an empty string |
On a product page:
{'!msBundles' | snippet : [
'product' => $_modx->resource.id,
'tpl' => 'tplMsBundlesItem',
'wrapperTpl' => 'tplMsBundlesList',
'emptyTpl' => 'tplMsBundlesEmpty',
'activeOnly' => true,
'quantity' => 1
]}[[!msBundles?
&product=`[[*id]]`
&tpl=`tplMsBundlesItem`
&wrapperTpl=`tplMsBundlesList`
&emptyTpl=`tplMsBundlesEmpty`
&activeOnly=`1`
&quantity=`1`
]]Single bundle by ID:
{'!msBundles' | snippet : [
'bundle' => 5,
'tpl' => 'tplMsBundlesItem',
'wrapperTpl' => 'tplMsBundlesList'
]}[[!msBundles?
&bundle=`5`
&tpl=`tplMsBundlesItem`
&wrapperTpl=`tplMsBundlesList`
]]Several bundles on a landing page:
{'!msBundles' | snippet : [
'bundles' => '5,8,12',
'wrapperTpl' => 'tplMsBundlesList',
'tpl' => 'tplMsBundlesItem'
]}[[!msBundles?
&bundles=`5,8,12`
&wrapperTpl=`tplMsBundlesList`
&tpl=`tplMsBundlesItem`
]]All active bundles in the current context:
{'!msBundles' | snippet : [
'list' => 'all',
'wrapperTpl' => 'tplMsBundlesList'
]}[[!msBundles?
&list=`all`
&wrapperTpl=`tplMsBundlesList`
]]To a placeholder:
{'!msBundles' | snippet : [
'product' => $_modx->resource.id,
'toPlaceholder' => 'bundlesHtml'
]}
{$_modx->getPlaceholder('bundlesHtml')}[[!msBundles?
&product=`[[*id]]`
&toPlaceholder=`bundlesHtml`
]]
[[+bundlesHtml]]Card and composition placeholders: Frontend. Always call msBundles.initialize nearby.