Get the Category Position from Product

Questions around the TYPO3 integration and plugins
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
rvhelp2
Posts: 29
Joined: 29 Oct 2022, 10:10

Get the Category Position from Product

Post by rvhelp2 » 14 Mar 2023, 18:09

Hello,



I am searching for certain products by attribute. From these products I need the position in the respective category. I understand that a product has several categories and each its own position. Is there a way how I can include a category to get the positions via JSON API?

/shop/json-api?ai[resource]=product&ai[include]=product,attribute,price,label,media,text&ai[sort]=relevance

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

Re: Get the Category Position from Product

Post by aimeos » 15 Mar 2023, 21:29

Add "catalog" to the "include" parameter. Then, you get the categories these products are attached too and the "relationships/catalog/data" sections contain the "product.lists.position" attribution with the position of the product within that category.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

rvhelp2
Posts: 29
Joined: 29 Oct 2022, 10:10

Re: Get the Category Position from Product

Post by rvhelp2 » 24 Mar 2023, 10:25

Thx! It is also possible to add the category filter to the attribut filter (if all products with the attribut are in the same category). then it will be auto sorted by relevance/ category index.

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

Re: Get the Category Position from Product

Post by aimeos » 27 Mar 2023, 17:11

Not sure if I understand correctly what you want to achieve. Can you describe in more detail, please?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply