
ms3ProductSets
Dynamic product recommendations for MiniShop3. Manual links, auto rules, manager templates
- MODX 3
- PHP 8.1
- miniShop3


A set type chooses which manual links to read and which auto logic to run when those links are empty.
ms3_product_sets for (product_id, type) are checked first. Unpublished and deleted IDs are dropped (msps_filter_valid_product_ids). One bad ID does not empty the block. showUnpublished=true will not bring those IDs back from the table.hideIfEmpty=true → empty string ''hideIfEmpty=false → emptyTplmax_items is clamped to 1..100.return=ids, the snippet returns only the ID list.resource_id / productId: base productcategory_id: forced category for auto modesset_id: VIP set number (vip_set_{set_id})exclude_ids: IDs to excludebuy_together “Frequently bought together” on the product card.
Priority:
type=buy_together.msps_get_auto_sales (co-purchase from orders).msps_get_auto_recommendations by product category/category_id.{'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`
]]similar Alternatives from the same category.
Priority:
type=similar.msps_get_similar_products: parent) of the current productexclude_ids excluded{'ms3ProductSets' | snippet : [
'type' => 'similar',
'resource_id' => $_modx->resource.id,
'exclude_ids' => $_modx->resource.id,
'max_items' => 8,
'tpl' => 'tplSetItem'
]}[[!ms3ProductSets?
&type=`similar`
&resource_id=`[[*id]]`
&exclude_ids=`[[*id]]`
&max_items=`8`
&tpl=`tplSetItem`
]]popcorn Compact impulse / add-on block.
Priority:
type=popcorn.resource_id=0, then shuffle).{'ms3ProductSets' | snippet : [
'type' => 'popcorn',
'resource_id' => $_modx->resource.id,
'max_items' => 4,
'tpl' => 'tplPopcorn'
]}[[!ms3ProductSets?
&type=`popcorn`
&resource_id=`[[*id]]`
&max_items=`4`
&tpl=`tplPopcorn`
]]cart_suggestion Suggestions in the cart or before checkout.
Priority:
type=cart_suggestion.category_id or resource_id category.{'ms3ProductSets' | snippet : [
'type' => 'cart_suggestion',
'category_id' => 5,
'resource_id' => 0,
'max_items' => 6,
'tpl' => 'tplSetItem'
]}[[!ms3ProductSets?
&type=`cart_suggestion`
&category_id=`5`
&resource_id=`0`
&max_items=`6`
&tpl=`tplSetItem`
]]auto_sales Recommendations from real orders (“often bought together”).
Priority:
type=auto_sales.ms3_order_product + ms3_order, statuses 2,4,5).similar.{'ms3ProductSets' | snippet : [
'type' => 'auto_sales',
'resource_id' => $_modx->resource.id,
'max_items' => 6,
'tpl' => 'tplSetItem'
]}[[!ms3ProductSets?
&type=`auto_sales`
&resource_id=`[[*id]]`
&max_items=`6`
&tpl=`tplSetItem`
]]vip Manual promo sets and campaign blocks.
Priority:
type=vip.ms3productsets.vip_set_{set_id}.If set_id is missing or less than 1, set_id=1 is used.
{'ms3ProductSets' | snippet : [
'type' => 'vip',
'set_id' => 1,
'max_items' => 8,
'tpl' => 'tplSetVIP'
]}[[!ms3ProductSets?
&type=`vip`
&set_id=`1`
&max_items=`8`
&tpl=`tplSetVIP`
]]auto General recommendations for home, categories and landings.
Priority:
type=auto.msps_get_auto_recommendations: resource_id)category_id{'ms3ProductSets' | snippet : [
'type' => 'auto',
'category_id' => 5,
'resource_id' => 0,
'max_items' => 12,
'tpl' => 'tplSetItem'
]}[[!ms3ProductSets?
&type=`auto`
&category_id=`5`
&resource_id=`0`
&max_items=`12`
&tpl=`tplSetItem`
]]also-bought and cross-sell use the same auto path as buy_together (co-purchase, then category).custom is handled as auto.Auto chains when manual links are empty:
| Type | When there are no manual links |
|---|---|
buy_together / also-bought / cross-sell | co-purchase (msps_get_auto_sales) → category |
similar | similar by category |
popcorn | auto by category → random catalog (resource_id=0) |
cart_suggestion | auto by category/category_id |
auto_sales | order stats → fallback to similar |
vip | system setting vip_set_{set_id} |
auto | auto by category/catalog |
auto/similar and add manual links only for key SKUs.vip + system settings work well.auto_sales ensure enough orders exist, otherwise you will often fall back to similar.sortby. Auto modes are often random.