How can I display related products on a 404 page?

I want to show related products on the 404 page. For example, if a customer searches for a cell phone and the link is broken, I want the 404 page to show similar cell phones. Is there any way to do this or any application?

If the url gives you enough clues on what to look for or what to display you can certainly edit the theme to do this. Since you’re calling out the need for “similar” that’s where it might get a little trickier. How complex does the url matching need to be?

One way would be to look at the url, and do an async search. Once the results are returned show those in whatever nice format you’d like.

I imagine you’d have the 404 data to help drive the matrix of terms, so you could then manually assign that to a keyword for storefront search.

If you didn’t want to use storefront search results you could also just pull in data async from a collection instead. It’s the same theory.

Do you know how to get started with that?

What would be the way to look at the URL and do an asynchronous search?