soryBySelector is not sorting entries on the Front end.
See original GitHub issueI have setup a replica indice in Algolia dashboard as per what has been written on the algolia documentation.
On seeing the filter/sort in the frontend I go to click filter on Price high or price low and nothing happens, I have even checked the console and nothing is happening on the algolia api calls.
https://viaduct.frb.io/products/bedroom-furniture
What I would expect to see is the items filtering
- OS: mac
- Browser chrome/safari/firefox
- Version latest
Here is my code for the functionality:
var searchProducts = instantsearch({
// Replace with your own values
appId: 'NHF40KMICV',
apiKey: '91615faeab7c9c7e761f22279d5d1513', // search only API key, no ADMIN key
indexName: 'www.viaduct.co.uk_allProducts',
urlSync: false,
searchParameters: {
hitsPerPage: 500
}
});
// types.level2.title
if( $('#types').length ){
searchProducts.addWidget(
instantsearch.widgets.refinementList({
container: '#types',
attributeName: 'types.level2.title',
operator: 'or'
})
);
}
if( $('#selectedFilters').length ){
searchProducts.addWidget(
instantsearch.widgets.currentRefinedValues({
container: '#selectedFilters',
onlyListedAttributes: true,
attributes: [{name: 'types', label: 'Types'},{name: 'types.level2.title', label: 'Type'},{name: 'productPrice', label: 'Price'},{name: 'material', label: 'Material'}],
clearAll: 'after'
})
);
}
if( $('#price-refinement').length ){
searchProducts.addWidget(
instantsearch.widgets.sortBySelector({
container: '#price-refinement',
indices: [
{ name: 'www.viaduct.co.uk_allProducts', label: 'Price' },
{name: 'products_by_price_low', label: 'Price lowest'},
{name: 'products_by_price_high', label: 'Price highest'}
],
label: 'Price'
})
);
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (7 by maintainers)
Top Results From Across the Web
View sorting isn't working
Check sorting in Gravity Forms: GravityView relies on Gravity Forms to fetch and sort the entries displayed on the front end of your...
Read more >Time Entries Submitted From Juris Suite not Sorting Correctly ...
This is a known issue in Juris. There is a workaround, however: Go to JurisSuite > Firm Settings. Click My Time and scroll...
Read more >Could you please help us display the sort order on the front end
I was unable to display the sort order on the front end in the same way that it looks using your plugin. you...
Read more >Array sorting in Front-end or Back-end [closed] - Stack Overflow
Agree. The backend should return array of objects that can be sorted by different properties such as created_at , order , title etc......
Read more >Sort entries in a category or entries field?
Both - when I click on the Category on the front end I want to load the products in that category - but...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I can see requests being done and the index name being changed, so this should work. Is the sort by different in the dashboard if you go to the different indices?
Closing this for now. If there are any updates, feel free to open a new issue. Thanks for your understanding.