- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Magento 2 tree category. Admin. System
Hi
How to display a category tree in system.xml and from weseckbox and after "save" have a table of selected categories?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2 tree category. Admin. System
Actually, I mean the category tree where I select and deselect categories in the checkbox.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2 tree category. Admin. System
@liteblue wrote:Hi
How to display a category tree in system.xml and from weseckbox and after "save" have a table of selected categories?
What is the problem? Just add condition : IF currentCategory dosn't have childs THEN use parent id of currentCategory as currentCategoryId
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2 tree category. Admin. System
This is not the problem. I do not know how to have in system.xml just like here, but that they should be categories
tree
I am a beginner in Magento programming and I don't know how to deal with it
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Magento 2 tree category. Admin. System
I managed to do just like in the picture. But unfortunately it saves only one value for me
<field id="ep_category" translate="label" type="checkboxes" sortOrder="1" showInDefault="1" showInWebsite="0" showInStore="0"> <label>Wybierz katetegorie</label> <source_model>Test\Ep\Model\Config\Source\Category</source_model> <backend_model>Magento\Config\Model\Config\Backend\Serialized\ArraySerialized</backend_model> </field>