Hi!
Something that I've been trying to change for some time now but just can't seem to figure it out:
Using instant search works for the most part, but if there are certain characters in the name of the product then on clicking search it returns an empty page.
E.g. If i search for say "Brevpapper A4" and press search, then I come to a page with this/these products listed.
However, if I search for "T-shirt" I come to a blank page. On removing the "-" from the URL and replacing with "%20" then I get a result.
So basically my question is how to rewrite the URL when it contains certain characters when searching?
In my InstantSearch.js I have the following code and it is here I am assuming the changes should be made. I've just not managed to figure it out ...
Dynamicweb.Frontend.InstantSearch._queryParam = function (name) {
/// <private />
/// <summary>Returns a query-string parameter value.</summary>
/// <param name="name">Parameter name.</param>
var ret = '';
var rx = null;
var results = null;
if (name) {
//name = name.replace("-","%20");
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]").replace("-", "pooo");
rx = new RegExp("[\\?&]" + name + "=([^&#]*)");
//rx = rx.replace("-","%20");
results = rx.exec(window.location.href);
if (results != null)
ret = decodeURIComponent(results[1].replace(/\+/g, " "));
}
return ret;
}
Thanks!!