MODX msCategory Auto-Option Assigner is a high-performance PHP script that automatically finds all used product characteristics (MiniShop2 options) and assigns them to their corresponding categories.
This ensures that every option is visible, editable, and displayed on the site — without manual setup.
✅ Works on large stores — tested on projects with 100K+ products, hundreds of categories, and thousands of options
✅ No manual category-option linking — fully automated
✅ Keeps existing data intact, only adds missing relations
✅ Compatible with MODX Revolution + MiniShop2
✅ Production-tested on 20+ real-world stores
By default in MiniShop2, product characteristics (options) are linked to categories manually.
This leads to:
❌ Problem | 💥 Impact |
---|---|
Products have options, but they are not visible in the backend | Impossible to edit them |
Options not linked to category | They don’t appear on product pages |
Manual linking takes hours | Huge waste of time on large stores |
Easy to miss important characteristics | Loss of sales due to missing filters |
✅ Feature | 🚀 Benefit |
---|---|
Automatically finds all used product options | Zero manual work |
Links options to their respective categories | Immediate visibility in backend |
Keeps existing links untouched | Safe to run multiple times |
Handles huge catalogs | Works with 100K+ products |
Pure SQL + MODX API | Fast and reliable |
Production-tested | Stable on live sites |
-
Place the script in your MODX project root or
core/components/
folder. -
Connect it in
index.php
or run via CLI:bash php auto-option-assigner.php
or use Console packet for modx, or connect modx api to file next to index.php -
The script will:
- Get all categories
- Find all products inside them
- Detect all used product options
- Link them to the category if not already linked
-
Done ✅ — All product characteristics are now visible and editable.
After running:
- 🕒 Hours saved — no more manual linking
- 🔍 All options visible in category editing
- 📊 Better filtering on product listing pages
- 💻 Immediate backend improvement without core hacks
Component | Details |
---|---|
Language | PHP 7+ |
Database | MySQL / MariaDB |
CMS | MODX Revolution |
Extra | MiniShop2 |
Method | SQL + MODX xPDO API |
Compatibility | Tested on MODX Revo 2.x–3.x |
MIT — free to use, modify, and integrate in your projects.