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 ​

Product sets for MiniShop3. Reads manual links from ms3_product_sets and drops unpublished or deleted IDs. An empty list with ms3productsets.auto_recommendation = 1 runs the type auto logic. vip ignores that setting.

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 uses buy_together.

Parameters ​

ParameterDescriptionDefault
typeSet typebuy_together
resource_id / productIdProduct ID (context resource)current resource
category_idCategory for msps_get_auto_recommendations. Does not affect similar or auto_sales SQL0
set_idVIP set (vip_set_{set_id})0
max_itemsLimit (1–100). Omitted calls use property 10, not the system setting10
tplCard chunk. tplSetVIP / tplPopcorn use itemTpl for the rowtplSetItem
itemTplRow chunk for VIP/popcorn wrappers''
set_titleVIP wrapper title''
discount_percentVIP wrapper badge. At 0 the badge is hidden0
showLogPassed to msProductsfalse
tplWrapperBlock wrapper: output, type, count, product_ids''. Chunk name such as tplSetWrapper
emptyTplEmpty result chunktplSetEmpty
hideIfEmptytrue returns empty string. false returns emptyTpltrue
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
toPlaceholderResult in a placeholder (not passed to msProducts)''

Other call parameters go to msProducts.

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`
]]