Get Parent Id from catalog

How to configure and adapt Aimeos based shops as developer
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!
Bananamoon
Posts: 26
Joined: 22 Jun 2015, 09:12

Get Parent Id from catalog

Post by Bananamoon » 22 Jun 2015, 09:16

Hello,

I am trying to get the Parent item from a Catalog item through the parentid, however there doesn't seem to be a getParentId function available. I also tried with other functions (like searchItems) with no success whatsoever.

Is there any way I am missing to get this parentid/item?
Thanks for the help!

User avatar
aimeos
Administrator
Posts: 7820
Joined: 01 Jan 1970, 00:00

Re: Get Parent Id from catalog

Post by aimeos » 22 Jun 2015, 09:28

Bananamoon wrote: I am trying to get the Parent item from a Catalog item through the parentid, however there doesn't seem to be a getParentId function available. I also tried with other functions (like searchItems) with no success whatsoever.

Is there any way I am missing to get this parentid/item?
The catalog items don't link to their parents and you can traverse them only downwards.

If you want to retrieve all parents of a node up to the tree root, you can use the getPath() method of the catalog manager:
https://github.com/aimeos/arcavias-core ... t.php#L437

Post Reply