Adding product sort
Your marketplace has shop pages with shop details and product categories. You want to give buyers a way of organizing the products, in dedicated pages.
In this tutorial, you'll add sort functionality to shops. You'll set up product sort by title, price, best-selling, and creation date, but you can follow a similar structure to provide sort options by other product attributes. Refer to the Storefront API to see all supported sorting options.
What you'll learnAnchor link to section titled "What you'll learn"
After finishing this tutorial, you'll know how to add sort functionality to shop pages.
RequirementsAnchor link to section titled "Requirements"
- You've finished the tutorial for adding product categories.
Sort products from the Storefront APIAnchor link to section titled "Sort products from the Storefront API"
Update the products query to accept
You can use this data in sort selectors for pages. The following is an example: