From 28b677bf365117d29b13b36bbfc3de2c60623d2c Mon Sep 17 00:00:00 2001 From: Ivan Bochkarev Date: Fri, 8 May 2026 10:02:10 +0600 Subject: [PATCH 1/5] fix(manager): options category tree root for nested catalog (#237) Add ms3_option_category_tree_parent setting and resolve parent=0 in OptionsController::getTree. Expose optionCategoryTreeParent in ms3.config; Vue passes rootParent. CHANGELOG + ru/en lexicons. --- _build/elements/settings.php | 5 +++++ .../controllers/category/update.class.php | 1 + .../controllers/mgr/settings.class.php | 1 + .../minishop3/lexicon/en/setting.inc.php | 3 +++ .../minishop3/lexicon/ru/setting.inc.php | 3 +++ .../Api/Manager/OptionsController.php | 20 +++++++++++++++++-- .../src/components/CategoryOptionsTab.vue | 7 +++++-- .../src/components/OptionCategoryTree.vue | 2 +- vueManager/src/components/OptionsGrid.vue | 13 +++++++++--- 9 files changed, 47 insertions(+), 8 deletions(-) diff --git a/_build/elements/settings.php b/_build/elements/settings.php index ab4375ac9..e468e1790 100644 --- a/_build/elements/settings.php +++ b/_build/elements/settings.php @@ -35,6 +35,11 @@ 'xtype' => 'combo-boolean', 'area' => 'ms3_category', ], + 'ms3_option_category_tree_parent' => [ + 'value' => 0, + 'xtype' => 'numberfield', + 'area' => 'ms3_options', + ], 'ms3_template_category_default' => [ 'value' => '', 'xtype' => 'modx-combo-template', diff --git a/core/components/minishop3/controllers/category/update.class.php b/core/components/minishop3/controllers/category/update.class.php index dadb9a37b..41fc39128 100644 --- a/core/components/minishop3/controllers/category/update.class.php +++ b/core/components/minishop3/controllers/category/update.class.php @@ -75,6 +75,7 @@ public function loadCustomCssJs() 'connector_url' => $this->ms3->config['connectorUrl'], 'show_options' => $showOptions, 'default_thumb' => $this->ms3->config['defaultThumb'], + 'optionCategoryTreeParent' => (int)$this->modx->getOption('ms3_option_category_tree_parent', null, 0), 'show_nested_products' => (bool) $this->modx->getOption('ms3_category_show_nested_products', null, true), 'category_products_rows' => (int) $this->getOption('ms3_category_products_default_rows', null, 20), ); diff --git a/core/components/minishop3/controllers/mgr/settings.class.php b/core/components/minishop3/controllers/mgr/settings.class.php index ccea0f54d..66e5e15b6 100644 --- a/core/components/minishop3/controllers/mgr/settings.class.php +++ b/core/components/minishop3/controllers/mgr/settings.class.php @@ -64,6 +64,7 @@ public function loadCustomCssJs() $config = $this->ms3->config; $config['default_thumb'] = $this->ms3->config['defaultThumb']; + $config['optionCategoryTreeParent'] = (int)$this->modx->getOption('ms3_option_category_tree_parent', null, 0); $this->addHtml('