-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Expected Behavior
So the getCategoryProducts do not support sort param or rather order in PrestaShop.
Actual Behavior
When providing sort options on the frontend, the server-api skips sort parameter while using: search method from useFacet composable. This means that sorting is not possible. Additionally, getSortOptions from facetGetters do not produce proper sorting options, but this is easy to solve with code like this:
const sortByOptions = result.value.data.sort_orders.map(order => ({ value: order.urlParameter, label: order.label }))
const route = useRoute()
const selectedSort = ref(route.value?.query?.sort || sortByOptions.find(order => order.label === result.value.data.sort_selected).value)Possible Solution
Sot the solution would be adding an order parameter to the getCategoryProducts API call params.
Steps to reproduce
No response
What version of PrestaShop integration are you using?
1.0.0
What version of Node.js are you using?
14
What browser (and version) are you using?
Brave
What operating system (and version) are you using?
macOS
Relevant log output
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working