Get attributes bases on catalog
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!
-
- Advanced
- Posts: 114
- Joined: 08 Nov 2019, 11:56
Get attributes bases on catalog
Hello,
We are using JSON API into mobile application. Now, we want to set filtering into products (mostly like flipkart and amazon). For that we want to get all attribute list based on catalog.
But, as per current document, Attribute API is returning all attributes into response. So, We cant use it at the moment.
Is there anyway through which we can get attribute list by catalog id (It means attributes which are used into particular catalog's products)
Thanks
We are using JSON API into mobile application. Now, we want to set filtering into products (mostly like flipkart and amazon). For that we want to get all attribute list based on catalog.
But, as per current document, Attribute API is returning all attributes into response. So, We cant use it at the moment.
Is there anyway through which we can get attribute list by catalog id (It means attributes which are used into particular catalog's products)
Thanks
Re: Get attributes bases on catalog
Attributes are not assigned to categories but to products so you can't limit attributes to one or more categories. The solution is to fetch all attributes once and use the aggregation capability of the product endpoint to fetch the number of products for each attribute:
https://aimeos.org/docs/latest/frontend ... g-products
If the "attributes" value in the response is 1 or higher, display the attribute in the frontend, otherwise hide it.
https://aimeos.org/docs/latest/frontend ... g-products
If the "attributes" value in the response is 1 or higher, display the attribute in the frontend, otherwise hide it.
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