Sort products
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
Sort products
Hello,
We are using JSON APIs into mobile application for eCommerce. Now, We have end point to get all products and get all products by category.
We have option to assigned them position into categories products. But we are not able to get those products by position.
If we call api to get products without any filters then it is working, but if we pass category id using filter[f_catid] then products are not sorted as per admin position
Regards
We are using JSON APIs into mobile application for eCommerce. Now, We have end point to get all products and get all products by category.
We have option to assigned them position into categories products. But we are not able to get those products by position.
If we call api to get products without any filters then it is working, but if we pass category id using filter[f_catid] then products are not sorted as per admin position
Regards
Re: Sort products
You must use
Code: Select all
<product endpoint>?filter[f_catid]=123&sort=relevance
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
-
- Advanced
- Posts: 114
- Joined: 08 Nov 2019, 11:56
Re: Sort products
I have tried but its it not working with category filter. I set position for multiple products and tried end point with
sort=relevance and sort=-relevance. Both time result is same
sort=relevance and sort=-relevance. Both time result is same
Re: Sort products
"-relevance" doesn't exist. If you add filter[f_catid]=10 to the JSON REST API URL of the product endpoint, the returned list of products is automatically sorted by the positions you've assigned to the product references in the catalog panel of the admin interface.
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
- QuốcTrungNguyễnHoàng
- Posts: 14
- Joined: 06 Aug 2019, 03:22
Re: Sort products
Sorry it not working,
It still sort by product.id
Both add sort: 'relevance' or not add with filter: {f_catid: categoryId}
It work after i'm rebuild index
It still sort by product.id
Both add sort: 'relevance' or not add with filter: {f_catid: categoryId}
It work after i'm rebuild index
Re: Sort products
Only one price is stored in the mshop_index_price table and this is the one customers can sort by. If you want to sort by several price types (default and listprice for example), you would have to extend the table by the price type, extend the index price manager to store prices of all types and extend the frontend controller and/or the HTML client to pass the price type to the filter.
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: Sort products
Small bug:
Sort by Rating works well.
But It won't be bold, when selected.
Sort by Rating works well.
But It won't be bold, when selected.
Re: Sort products
Thanks for the hint! This has been fixed now in aimeos/ai-client-html dev-master and 2022.10.x-dev
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