Change hits per page selector

HI
I Need to change hitsPerPageSelector to pagination . this is some thing like
ex
in the drop down we can define how many products should be displayed per page like 60/120/240.but I need to define those values in pagination.is there a way to do this using https://community.algolia.com/instantsearch.js/documentation/#navigation ?

Thanks

I don’t understand what you mean by this. Can you give me more details?

Pagination is updated when the hitPerPage value changes.

HI
Right now I am using below code to add drop down with option as follows

search.addWidget(
algoliaBundle.instantsearch.widgets.hitsPerPageSelector({
container: ‘#hits-per-page-selector’,
options: [
{value: 15, label: ‘15’},
{value: 30, label: ‘30’},
{value: 100, label: ‘100’},
{value: 200, label: ‘200’}
]
})
);

I need those values to be in pagination.is there any way to do that
Thanks

HI @julienbourdeau
is that clear to you ?

Thanks

Do you mean that you want to selector to be next to the pagination?

Hi
This is the exact way I need to have
Currently this displays values like this.

but I want that to be like this

I believe this would give you the correct idea

Thanks

HI ALL
Any idea implementing above solution ?

Thanks

hi @julienbourdeau

IS there any way to do that ?

Hi,

It is possible but it’s not handle out of the box. You will have to write a new custom widget: https://community.algolia.com/instantsearch.js/documentation/#custom-widgets

Then, you will need to update this file accordingly: https://github.com/algolia/algoliasearch-magento/blob/master/js/algoliasearch/instantsearch.js

If you manage to do it, feel free to share your code here :slight_smile:

@julienbourdeau, I have a similar question. How to control the number of hits when the search is done.

Hell @yashu,

you can specify number of hits in either “Autocomplete” or “Products” section of configuration:

41