dionarap's avatar

Sort feature returns to default

I have a search system that returns products, it has a sort feature where i can sort the results on user ratings or A-Z etc; this feature is handled by AJAX as is the pagination.

I am having one issue with this system and that is that when i click onto a product page and then return to the results page by clicking the back browser button it will forget what value the results were sorted by even if i've used pushstate to add it to the url and it will return the default orderby and the same happens if i refresh.

What is the best way to fix this issue? here is the code i have currently.

0 likes
2 replies
dionarap's avatar

@MVD - So this is the issue why its returning default? Usually if i click back from entering a product page the option that was selected on the select is remembered for example if i click on A-Z then click on a product and click back then the select is still on A-Z. The problem is that the results return to the default case?

Please or to participate in this conversation.