Skip to content
ms3RecentlyViewed
ms3RecentlyViewed
"Recently viewed products" block for MiniShop3 — browser or DB storage, similar products, manager
  1. Extras
  2. ms3RecentlyViewed
  3. Snippets
  4. ms3recentlyviewedSimilar

Snippet ms3recentlyviewedSimilar

Outputs products from the same categories (parents) as the given viewed IDs, excluding those IDs. “Similar to viewed” block.

Optimization: a single getCollection query for parent categories of all viewed products instead of N separate queries.

Parameters

ParameterDescriptionDefault
idsComma-separated viewed product IDs
tplProduct card chunktplSimilarItem
limitMax items in result10
depthCategory search depth (nesting levels)1

Examples

fenom
{'ms3recentlyviewedSimilar' | snippet : [
  'ids' => $viewedIds,
  'limit' => 8,
  'tpl' => 'tplViewedItem'
]}
modx
[[!ms3recentlyviewedSimilar?
  &ids=`[[+viewedIds]]`
  &limit=`8`
  &tpl=`tplViewedItem`
]]

If viewed products have no categories or those categories have no other products, the snippet returns an empty string.

Via connector (AJAX): POST with action=similar, parameters ids, optionally limit, tpl, depth.