Hello team, I have a product requirement to sort all the goods, and the existing API can only sort the goods on the current page. Is it possible to add such a function?
Sorry, what do you mean by goods?
Can you please provide more information around what you’re trying to achieve?
We have a requirement to implement a sorting feature for all products on the product page. However, the platform API does not support sorting all products. Could we add functionality to sort by certain product parameters instead, such as the handle, etc.?
Hi @lss_lss,
You certainly can add custom filtering on your Shopify store via Storefront Filters, or Product Tag Filters. With Storefront Filters specifically you can create custom sorting options for product collections and search results based on existing product data, like the handle, availability, price, variant options, etc.
Here’s some documentation you can refer to for more information on how to implement this:
Hello team,Currently, I have a scenario where I’m on the product category page and I need to display specific products among my thousands of products based on their names, for example, the first 20. Different categories or different users may have different product displays. At this point, I put the product handle in my URL to sort the products based on this. However, the API only supports sorting the data of the current page. If I want to sort all the products, how should I do it?
If Shopify’s API’s don’t accommodate what you need for sorting, you’ll either need to:
- request all products client-side, then handle the sorting you desire
- sync all products to your own database and build out an endpoint to request products with the sorting you desire
- use a third party like Algolia
I’m thinking that it might be better for the official team to implement this feature. I believe many people would want this function. Since we have already provided sort_by, could we also offer a sort_handle?
It’s not that straight forward to just implement something, so I’d advise following one of the options or similar that I suggest.
Thank you. I’ll give it a try following the plan you suggested.
