Skip to content
ms3ProductSets
ms3ProductSets
Dynamic product recommendations for MiniShop3. Manual links, auto rules, manager templates
  • MODX 3
  • PHP 8.1
  • miniShop3
  1. Extras
  2. ms3ProductSets
  3. Snippets
  4. ms3ProductSets

Snippet ms3ProductSets ​

Outputs product sets for MiniShop3. First reads manual links from ms3_product_sets and drops unpublished or deleted IDs. If the filtered list is empty, applies auto logic by type.

Supported types ​

  • buy_together
  • similar
  • popcorn
  • cart_suggestion
  • auto_sales
  • vip
  • auto
  • also-bought, cross-sell (same auto path as buy_together)
  • custom (same as auto)

Unknown type falls back to buy_together.

Parameters ​

ParameterDescriptionDefault
typeSet typebuy_together
resource_id / productIdProduct ID (context resource)current resource
category_idCategory ID for auto mode0
set_idVIP set number (vip_set_{set_id})0
max_itemsProduct limit (1–100)ms3productsets.max_items
tplCard chunk (tplSetVIP / tplPopcorn use itemTpl for the row)tplSetItem
itemTplRow chunk when tpl is a VIP/popcorn wrapper''
set_title / discount_percentPlaceholders for the VIP wrapper''
showLogPassed to msProductsfalse
tplWrapperBlock wrapper chunk (output, type, count)'' (no wrapper; set a chunk name such as tplSetWrapper)
emptyTplEmpty result chunktplSetEmpty
hideIfEmptytrue: empty string. false: emptyTpl.true
exclude_idsProduct IDs to exclude''
showUnpublishedPassed to msProductsfalse
showHiddenPassed to msProductsfalse
sortby / sortdirOutput sortorder from set
tvPrefix, includeTVs, includeThumbspdoTools/msProducts params''
returnFormat: data, ids, jsondata
toPlaceholderWrite result to placeholder''

Examples ​

fenom
{'ms3ProductSets' | snippet : [
  'type' => 'buy_together',
  'resource_id' => $_modx->resource.id,
  'max_items' => 6,
  'tpl' => 'tplSetItem'
]}
modx
[[!ms3ProductSets?
  &type=`buy_together`
  &resource_id=`[[*id]]`
  &max_items=`6`
  &tpl=`tplSetItem`
]]

VIP set:

fenom
{'ms3ProductSets' | snippet : [
  'type' => 'vip',
  'set_id' => 1,
  'resource_id' => $_modx->resource.id,
  'tpl' => 'tplSetVIP'
]}
modx
[[!ms3ProductSets?
  &type=`vip`
  &set_id=`1`
  &resource_id=`[[*id]]`
  &tpl=`tplSetVIP`
]]

IDs only, no HTML:

fenom
{'ms3ProductSets' | snippet : ['type' => 'auto', 'return' => 'ids', 'category_id' => 5]}
modx
[[!ms3ProductSets?
  &type=`auto`
  &return=`ids`
  &category_id=`5`
]]