Skip to content

Commit 7f8de39

Browse files
ENGCOM-3050: Fix category tree in cart price rule #17493 #18175
- Merge Pull Request #18175 from magently/magento2:fix/catalog-rule-categories-selection - Merged commits: 1. 9f19592
2 parents 37f5661 + 9f19592 commit 7f8de39

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

app/code/Magento/Catalog/view/adminhtml/web/js/category-checkbox-tree.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ define([
230230

231231
categoryLoader.on('beforeload', function (treeLoader, node) {
232232
treeLoader.baseParams.id = node.attributes.id;
233+
treeLoader.baseParams.selected = options.jsFormObject.updateElement.value;
233234
});
234235

235236
/* eslint-disable */

app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Widget/CategoriesJson.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ public function execute()
7777
if (!($category = $this->_initCategory())) {
7878
return;
7979
}
80+
$selected = $this->getRequest()->getPost('selected', '');
8081
$block = $this->_view->getLayout()->createBlock(
8182
\Magento\Catalog\Block\Adminhtml\Category\Checkboxes\Tree::class
8283
)->setCategoryIds(
83-
[$categoryId]
84+
explode(',', $selected)
8485
);
8586
$this->getResponse()->representJson(
8687
$block->getTreeJson($category)

0 commit comments

Comments
 (0)