Cannot get the full tree of the categories using getTree
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Cannot get the full tree of the categories using getTree
Hello,
I have 3 level of categories. Root -> Lvl1 -> Lvl2 -> Lvl3
I have a problem getting the full tree of the categories to display in the client. Although I selected LEVEL_TREE both in the config and even tried it in a custom part as seen in the snippet code bellow, the function and the framework only returns the children of the root category provided.
This seems to be a bug in the getTree( ) function because I can only get the children of the start category no matter the category starting point.
Also to mention in the client area: If I select a category I immediately get their children, and the if I select a child, I get their children, but not by default.
Any ideas as to why is this behavior?
Thank you!
I have 3 level of categories. Root -> Lvl1 -> Lvl2 -> Lvl3
I have a problem getting the full tree of the categories to display in the client. Although I selected LEVEL_TREE both in the config and even tried it in a custom part as seen in the snippet code bellow, the function and the framework only returns the children of the root category provided.
This seems to be a bug in the getTree( ) function because I can only get the children of the start category no matter the category starting point.
Also to mention in the client area: If I select a category I immediately get their children, and the if I select a child, I get their children, but not by default.
Any ideas as to why is this behavior?
Code: Select all
$ref = $view->config( 'client/html/catalog/filter/tree/domains', array( 'text', 'media') );
$context = $this->getContext();
$controller = \Aimeos\Controller\Frontend\Factory::createController( $context, 'catalog' );
$catItems = $controller->getTree( null, $ref, \Aimeos\MW\Tree\Manager\Base::LEVEL_TREE );
- Attachments
-
- The full nodes with children shows only when I select the last category. Why?
- Screenshot 2019-06-25 at 11.52.02.png (142.65 KiB) Viewed 1756 times
Re: Cannot get the full tree of the categories using getTree
Guess, you are using Aimeos 2018.10.
The catalog/filter/tree component limits the shown category to those which are visible by default, so you don't get back the whole tree: https://github.com/aimeos/ai-client-htm ... d.php#L312
You can overwrite that method in your own class to get all nodes if you want to show hide them by Javascript. Might be also possible to add a configuration option to do this if you want to get this into the core and create a PR
The catalog/filter/tree component limits the shown category to those which are visible by default, so you don't get back the whole tree: https://github.com/aimeos/ai-client-htm ... d.php#L312
You can overwrite that method in your own class to get all nodes if you want to show hide them by Javascript. Might be also possible to add a configuration option to do this if you want to get this into the core and create a PR
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Cannot get the full tree of the categories using getTree
Thanks for the reply!
Can I upgrade to 2019 without breaking the current functionality?
I have a Laravel implementation.
Update:
I have some custom pages, and apparently in 2019 this : app( '\Aimeos\Shop\Base\Page' )->getSections( 'basic' );
no longer works (Class \Aimeos\Shop\Base\Page does not exist).
Where is the documentation for 2019? It seems the official one is not updated to the latest version?
How to you get sections in 2019 for custom pages?
I have used this: https://aimeos.org/docs/Laravel/Create_new_pages
Can I upgrade to 2019 without breaking the current functionality?
I have a Laravel implementation.
Update:
I have some custom pages, and apparently in 2019 this : app( '\Aimeos\Shop\Base\Page' )->getSections( 'basic' );
no longer works (Class \Aimeos\Shop\Base\Page does not exist).
Where is the documentation for 2019? It seems the official one is not updated to the latest version?
How to you get sections in 2019 for custom pages?
I have used this: https://aimeos.org/docs/Laravel/Create_new_pages
Re: Cannot get the full tree of the categories using getTree
Documentation is up to date now: https://aimeos.org/docs/Laravel/Create_ ... controller
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Cannot get the full tree of the categories using getTree
Missed it.
Thank you!
Thank you!