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)
#1667 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!
#1668 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/blob/master/lib/mshoplib/src/MShop/Catalog/Manager/Default.php#L437