Skip to content

Commit

Permalink
Fix category tree in cart price rule #17493
Browse files Browse the repository at this point in the history
  • Loading branch information
Krzysztof Wolowski committed Sep 10, 2018
1 parent 34ee561 commit 9f19592
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ define([

categoryLoader.on('beforeload', function (treeLoader, node) {
treeLoader.baseParams.id = node.attributes.id;
treeLoader.baseParams.selected = options.jsFormObject.updateElement.value;
});

/* eslint-disable */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,11 @@ public function execute()
if (!($category = $this->_initCategory())) {
return;
}
$selected = $this->getRequest()->getPost('selected', '');
$block = $this->_view->getLayout()->createBlock(
\Magento\Catalog\Block\Adminhtml\Category\Checkboxes\Tree::class
)->setCategoryIds(
[$categoryId]
explode(',', $selected)
);
$this->getResponse()->representJson(
$block->getTreeJson($category)
Expand Down

0 comments on commit 9f19592

Please sign in to comment.