Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Sorting is not supported #139

Open
1 task done
roszpun opened this issue Jun 22, 2024 · 1 comment
Open
1 task done

[Bug]: Sorting is not supported #139

roszpun opened this issue Jun 22, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@roszpun
Copy link

roszpun commented Jun 22, 2024

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
@roszpun roszpun added the bug Something isn't working label Jun 22, 2024
@roszpun
Copy link
Author

roszpun commented Jun 22, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant