
ms3RecentlyViewed
"Recently viewed products" block for MiniShop3 — browser or DB storage, similar products, manager
- MODX 3
- PHP 8.1
- miniShop3


"Recently viewed products" block for MiniShop3. The list lives in the browser (localStorage or cookie) or in the DB for logged-in users. It fills when a user opens a product page.
Naming: user-facing — ms3RecentlyViewed. In code (folders, snippets, lexicon) — ms3recentlyviewed.
render()), server snippet with fromDB, or ids from placeholder / cookie. See Quick start.localStorage (default) or cookie, no registrationlocalStorage to the DB (first visit after login)archive_enabled (on by default): summary in ms3recentlyviewed_monthly without deleting items rowsblock_bots + block_bots_detector (crawler_detect — CrawlerDetect library, or regex as fallback)OnWebPageInit, priority -5). Always sets [[+viewedIds]]. From the cookie when storage_type=cookie, otherwise empty. Fenom: {$_modx->getPlaceholder('viewedIds')}ms3recentlyviewedSimilar)ms3rvLexiconScriptms3rv). Storefront cards use Bootstrap classes, not --ms3rv-* variables| Requirement | Version |
|---|---|
| MODX Revolution | 3.0.3+ |
| PHP | 8.1+ |
| MySQL | 5.7+ / MariaDB 10.3+ |
@FILE chunksrequires, required at runtime)msProducts and parents
In MODX 3 the msProducts snippet requires the parents parameter even when using resources. The add-on supplies it when calling msProducts for the viewed list.
Load lexicon, CSS and JS. Pass the product ID on the product page. Output the block. Quick start, Frontend setup.
In the manager: Extras → ms3RecentlyViewed — dashboard and view history.
| Term | Description |
|---|---|
| Viewed | List of product IDs the user has opened (in browser or DB) |
| Sync | Moving the list from localStorage to the DB when the user logs in |
| Similar to viewed | Products from the same categories as viewed (snippet ms3recentlyviewedSimilar) |