Skip to content

Commit cfc2339

Browse files
Krzysztof Wolowskigelanivishal
authored andcommitted
Fix category tree in cart price rule magento#17493
1 parent a474225 commit cfc2339

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
@@ -225,6 +225,7 @@ define([
225225

226226
categoryLoader.on('beforeload', function (treeLoader, node) {
227227
treeLoader.baseParams.id = node.attributes.id;
228+
treeLoader.baseParams.selected = options.jsFormObject.updateElement.value;
228229
});
229230

230231
categoryLoader.on('load', function () {

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)