Skip to content

Products order #226

Answered by maarten2424
agsmartwolf asked this question in Help
Apr 20, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

Hey @agsmartwolf
Use the sort parameter to sort results. The format consists of <field> <direction>. Direction is recognized as a case-insensitive word like ascending and descending, or as abbreviated asc and desc.
You can combine multiple sort fields in a string or array, with the first taking precedence in order.

With the swell-js library the result would be:

await swell.products.list({
  sort: 'name asc',
})

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@agsmartwolf
Comment options

@logeshswell
Comment options

Answer selected by logeshswell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
3 participants