JSON API - Get product list and attributes of products belong to the catalog

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
User avatar
Kevin1596
Posts: 28
Joined: 13 Aug 2020, 10:11

JSON API - Get product list and attributes of products belong to the catalog

Post by Kevin1596 » 18 Jan 2021, 10:06

AIMEOS Laravel 2020.10.*

Thank you so much for all your helps so far.

In my use case, I want to get the product list of a catalog and get all the possible attributes of all the products in that catalog as a filter for customer further filter rather than fetch all the attributes of the shop.

The problem is if I get the first 20 products with "include: attribute" and "f_catid" in the product Api call,
it will only return the attribute belong to the first 20 products, in some case there will be unique attributes belong to later products so I could not get it.

Is there anyway to make this use case possible without fetch all the attributes before hand but get the attributes belong to the products of a catalog?

User avatar
Kevin1596
Posts: 28
Joined: 13 Aug 2020, 10:11

Re: JSON API - Get product list and attributes of products belong to the catalog

Post by Kevin1596 » 18 Jan 2021, 10:52

How could I calculate the total product of each attribute of catalog with json api as the image follow?
Screen Shot 2021-01-18 at 5.50.23 PM.png
Screen Shot 2021-01-18 at 5.50.23 PM.png (78.95 KiB) Viewed 1341 times

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

Re: JSON API - Get product list and attributes of products belong to the catalog

Post by aimeos » 19 Jan 2021, 10:52

Use the attribute endpoint of the JSON REST API to get all attributes:
https://aimeos.org/docs/latest/frontend ... ted-search
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply