Skip to content

Instantly share code, notes, and snippets.

@tivuno
Last active August 8, 2022 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tivuno/00d5ebcbfd3efc84ae3af0850ca60c51 to your computer and use it in GitHub Desktop.
Save tivuno/00d5ebcbfd3efc84ae3af0850ca60c51 to your computer and use it in GitHub Desktop.
@tivuno
Copy link
Author

tivuno commented Aug 8, 2022

Case study
Human in need: @prestan0ob
Website: marketnet.gr
No results when returning to a search page after visiting a product.

Steps to reproduce

  1. A store uses Joli search module.
  2. The user searches for a term (which produces results).
  3. He clicks on a result in the ”more results” page, not in the js-driven pop-up.
  4. He goes back to the results list.

Our approach
When going back, for some strange reason when the first time the search_query parameter has the characters encoded with %25 then adds more 25s in the link which leads to - obviously - no results, as it's a whole different story.
So we just convert the query to ”translate” it once again.
You just replace XXX with your own configuration.

Further fine tuning
The H1 tag which contains the search_query is escaped and the beautified text is properly displayed. On the same time, the string in the search bar is not. So you have to edit your tpl file and escape it there, as well.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment