@@ -477,6 +477,7 @@ var unbxdSearchInit = function(jQuery, Handlebars){
477
477
'</li>' ,
478
478
'{{/options}}'
479
479
] . join ( '' )
480
+ , searchQueryParam :"q"
480
481
} ;
481
482
482
483
jQuery . extend ( Unbxd . setSearch . prototype , {
@@ -1045,7 +1046,7 @@ var unbxdSearchInit = function(jQuery, Handlebars){
1045
1046
var nonhistoryPath = "" ;
1046
1047
1047
1048
if ( this . options . type == "search" && this . params [ 'query' ] != undefined ) {
1048
- url += '&q=' + encodeURIComponent ( this . params . query ) ;
1049
+ url += '&' + this . options . searchQueryParam + '=' + encodeURIComponent ( this . params . query ) ;
1049
1050
} else if ( this . options . type == "browse" && this . params [ 'categoryId' ] != undefined ) {
1050
1051
url += '&category-id=' + encodeURIComponent ( this . params . categoryId ) ;
1051
1052
}
@@ -1189,7 +1190,7 @@ var unbxdSearchInit = function(jQuery, Handlebars){
1189
1190
}
1190
1191
1191
1192
this . ajaxCall = jQuery . ajax ( {
1192
- url : urlobj . url
1193
+ url : urlobj . url . replace ( this . options . searchQueryParam + "=" , "q=" )
1193
1194
, dataType : "jsonp"
1194
1195
, jsonp : 'json.wrf'
1195
1196
, success : cb . bind ( self )
@@ -1300,8 +1301,8 @@ var unbxdSearchInit = function(jQuery, Handlebars){
1300
1301
params . extra . rows = this . options . pageSize ;
1301
1302
1302
1303
//lets get query
1303
- if ( "q" in obj )
1304
- params . query = obj . q ;
1304
+ if ( this . options . searchQueryParam in obj )
1305
+ params . query = obj [ this . options . searchQueryParam ] ;
1305
1306
1306
1307
//lets get category-id
1307
1308
if ( "category-id" in obj )
@@ -1356,7 +1357,7 @@ var unbxdSearchInit = function(jQuery, Handlebars){
1356
1357
1357
1358
} else {
1358
1359
1359
- this . params . query = obj . searchMetaData . queryParams . q ; //obj.didYouMean[0].suggestion;
1360
+ this . params . query = obj . searchMetaData . queryParams [ this . options . searchQueryParam ] ; //obj.didYouMean[0].suggestion;
1360
1361
1361
1362
if ( ! this . compiledSpellCheckTemp )
1362
1363
this . compiledSpellCheckTemp = Handlebars . compile ( this . options . spellCheckTemp ) ;
@@ -1412,7 +1413,7 @@ var unbxdSearchInit = function(jQuery, Handlebars){
1412
1413
this . totalPages = Math . ceil ( obj . response . numberOfProducts / this . getPageSize ( ) ) ;
1413
1414
1414
1415
jQuery ( this . options . searchQueryDisplay ) . html ( this . compiledSearchQueryTemp ( {
1415
- query : obj . searchMetaData . queryParams . q
1416
+ query : obj . searchMetaData . queryParams [ this . options . searchQueryParam ]
1416
1417
, numberOfProducts : obj . response . numberOfProducts
1417
1418
, start : this . productStartIdx
1418
1419
, end : this . productEndIdx
0 commit comments