Catalog tree
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!
Catalog tree
Hi there!
I have a catalog tree that i created from backend admin, I need to show the same tree in frontend but when i search all categories the hasChildren function always return false. This is part of my code
I'm using typo3 7.6.10, extbase and Aimeos 16.4.3
Thanks in advance
I have a catalog tree that i created from backend admin, I need to show the same tree in frontend but when i search all categories the hasChildren function always return false. This is part of my code
Code: Select all
$manager = \Aimeos\MShop\Factory::createManager( $context, 'catalog' );
$search = $manager->createSearch();
$categories = $manager->searchItems($search);
foreach ($categories as $category) {
if ( $category->hasChildren() ) {
// code stuff...
}
}
Thanks in advance
Re: Catalog tree
Well single items returned by searchItems() don't have children. Use the getTree() method of the catalog manager instead to get a tree of nodes instead.
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: Catalog tree
Thank you Mr. Aimeos, you are a genius!aimeos wrote:Well single items returned by searchItems() don't have children. Use the getTree() method of the catalog manager instead to get a tree of nodes instead.