
- MODX 3
- PHP 8.1
- miniShop3


Step-by-step wiring of product recommendation blocks (sets) on a MiniShop3 site.
Snippet names: ms3ProductSets, mspsLexiconScript.
Fenom examples require pdoTools 3.x.
| Requirement | Version |
|---|---|
| MODX Revolution | 3.0+ |
| PHP | 8.1+ |
| MiniShop3 | installed |
| pdoTools | 3.0.0+ |
| VueTools | installed (“Product sets” manager page) |
Package is available at modstore.pro.
Load lexicon, CSS and JS on the site, place the recommendation block in the product card template (ms3ProductSets snippet). Details below.
In the template (or shared head/footer), load lexicon first, then CSS and JS.
{'mspsLexiconScript' | snippet}
<link rel="stylesheet" href="{'assets_url' | option}components/ms3productsets/css/productsets.css">
<script src="{'assets_url' | option}components/ms3productsets/js/productsets.js" defer></script>[[!mspsLexiconScript]]
<link rel="stylesheet" href="[[++assets_url]]components/ms3productsets/css/productsets.css">
<script src="[[++assets_url]]components/ms3productsets/js/productsets.js" defer></script>On the product page template (or in the product card chunk inside a listing), call the ms3ProductSets snippet.
type parameter type selects the recommendation scenario: it determines which manual links are read from ms3_product_sets and which auto logic runs when manual links are missing. The shared rules for all values are in Set types (section “Common rules (all types)”).
type | Purpose (short) |
|---|---|
buy_together | “Frequently bought together” on the product card; auto by product category. |
similar | Similar products from the same category. |
popcorn | Compact impulse add-ons; extra fallback if the category path is empty. |
cart_suggestion | Cart / checkout suggestions; often with category_id. |
auto_sales | Order-statistics based set; falls back to similar when data is thin. |
vip | Fixed promo sets from vip_set_* settings; requires set_id. |
auto | Generic blocks (home, landings); often category_id and/or resource_id. |
This quick start uses buy_together for a typical product card.
Other call parameters:
resource_id — product ID the set is built for (on the product page, the current resource).max_items — max items in the block (allowed range 1…100).tpl — chunk for one product row; the package default tplSetItem is a good starting point.If the set is empty, the snippet returns an empty string by default (hideIfEmpty=true) — wrap the output in a conditional or use a placeholder for heading and markup; see Site integration. Per-type details: Set types.
{'ms3ProductSets' | snippet : [
'type' => 'buy_together',
'resource_id' => $_modx->resource.id,
'max_items' => 6,
'tpl' => 'tplSetItem'
]}[[!ms3ProductSets?
&type=`buy_together`
&resource_id=`[[*id]]`
&max_items=`6`
&tpl=`tplSetItem`
]]hideIfEmpty=true).ms3productsets.vip_set_1 (e.g. 12,34,56).{'ms3ProductSets' | snippet : [
'type' => 'vip',
'set_id' => 1,
'tpl' => 'tplSetVIP'
]}[[!ms3ProductSets?
&type=`vip`
&set_id=`1`
&tpl=`tplSetVIP`
]]