JSON API - get specific level of catalog from product
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!
JSON API - get specific level of catalog from product
Hello Aimeos, thank you for your efforts again
I have a small issue, this is the structure of my catalog, products
When i add the "include = catalog" parameter, i only get the direct related category, which is the Sub Category.
Is there a clean way to solve my request. (I thought about fetching the Sub Category, but there is no parameter that allows us to get the parent catalog if i'm not mistaken)
Aimeos : 2021.04
Laravel 8
Thank you again !
I have a small issue, this is the structure of my catalog, products
- Main Category
- Level 1 Category
- Sub Category
- My product
- Sub Category
- Level 1 Category
When i add the "include = catalog" parameter, i only get the direct related category, which is the Sub Category.
Is there a clean way to solve my request. (I thought about fetching the Sub Category, but there is no parameter that allows us to get the parent catalog if i'm not mistaken)
Aimeos : 2021.04
Laravel 8
Thank you again !
Re: JSON API - get specific level of catalog from product
Yes, using "include=catalog" will only return "Sub Category" and there's no way to retrieve the parent category within the same request. Also, the parent ID isn't exposed via the JSON API at all.
The only option would be to fetch "Main Category" including all subcategories once (depending on how much categories you have this may or may not be an option) and check which is the parent category of "Sub Category".
The only option would be to fetch "Main Category" including all subcategories once (depending on how much categories you have this may or may not be an option) and check which is the parent category of "Sub Category".
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: JSON API - get specific level of catalog from product
Thx, appreciate it.
All is clear.
All is clear.
Re: JSON API - get specific level of catalog from product
aimeos wrote: ↑07 Jul 2021, 08:24 Yes, using "include=catalog" will only return "Sub Category" and there's no way to retrieve the parent category within the same request. Also, the parent ID isn't exposed via the JSON API at all.
The only option would be to fetch "Main Category" including all subcategories once (depending on how much categories you have this may or may not be an option) and check which is the parent category of "Sub Category".
Thanks for you reply. In my case the option is doable, i only have few categories/subcategories