@@ -556,7 +556,8 @@ var unbxdSearchInit = function(jQuery, Handlebars){
556
556
finalParams = this . _processURL ( urlqueryparams ) ;
557
557
}
558
558
559
- if ( this . options . deferInitRender . indexOf ( 'search' ) > - 1
559
+ if ( this . options . deferInitRender . indexOf ( 'search' ) > - 1
560
+ && ! this . isUsingPagination ( )
560
561
&& finalParams . extra . hasOwnProperty ( 'page' )
561
562
&& finalParams . extra . page >= 1 )
562
563
finalParams . extra . page = finalParams . extra . page + 1 ;
@@ -1345,6 +1346,7 @@ var unbxdSearchInit = function(jQuery, Handlebars){
1345
1346
this . paintSelectedFacets ( ) ;
1346
1347
}
1347
1348
, paintProductPage : function ( obj ) {
1349
+ var start = 1 ;
1348
1350
if ( "error" in obj )
1349
1351
return ;
1350
1352
@@ -1364,24 +1366,31 @@ var unbxdSearchInit = function(jQuery, Handlebars){
1364
1366
this . getPage ( ) * this . getPageSize ( ) : obj . response . numberOfProducts ;
1365
1367
this . totalPages = Math . ceil ( obj . response . numberOfProducts / this . getPageSize ( ) ) ;
1366
1368
1367
- jQuery ( this . options . searchQueryDisplay ) . html ( this . compiledSearchQueryTemp ( {
1368
- query : obj . searchMetaData . queryParams . q
1369
- , numberOfProducts : obj . response . numberOfProducts
1370
- , start : this . productStartIdx
1371
- , end : this . productEndIdx
1372
- } ) ) . show ( ) ;
1369
+ jQuery ( this . options . searchQueryDisplay ) . html ( this . compiledSearchQueryTemp ( {
1370
+ query : obj . searchMetaData . queryParams . q
1371
+ , numberOfProducts : obj . response . numberOfProducts
1372
+ , start : this . productStartIdx
1373
+ , end : this . productEndIdx
1374
+ } ) ) . show ( ) ;
1373
1375
1374
1376
this . paintSort ( obj ) ;
1375
1377
this . paintPageSize ( obj ) ;
1376
1378
this . paintPagination ( obj ) ;
1379
+ obj . response . products = obj . response . products . map ( function ( product ) {
1380
+ product [ 'unbxdprank' ] = obj . response . start + start ;
1381
+ start += 1 ;
1382
+ return product ;
1383
+ } ) ;
1377
1384
1378
1385
if ( this . getClass ( this . options . searchResultSetTemp ) == 'Function' ) {
1379
1386
this . options . searchResultSetTemp . call ( this , obj ) ;
1380
1387
} else {
1381
1388
if ( ! this . compiledResultTemp )
1382
1389
this . compiledResultTemp = Handlebars . compile ( this . options . searchResultSetTemp ) ;
1383
1390
1391
+ if ( this . options . deferInitRender . indexOf ( 'search' ) === - 1 || ! this . isUsingPagination ( ) ) {
1384
1392
jQuery ( this . options . searchResultContainer ) . append ( this . compiledResultTemp ( obj . response ) ) ;
1393
+ }
1385
1394
}
1386
1395
1387
1396
if ( ! this . currentNumberOfProducts && typeof this . options . onIntialResultLoad == "function" ) {
0 commit comments