Author Topic: small addition to router.php to stop error message with Search range  (Read 1549 times)

derek webster

  • Jr. Member
  • **
  • Posts: 83
VirtueMart 3.8.4 10335

Hi Ive had a little bit of development work done and I'd like to submit this for inclusion into future VM builds.
We wnted our sef results to be cleaner - so changed /results,1-100?keyword=searchterm to this /results?keyword=searchterm

in Router.php we were getting an error when searching when there was no limit defined.

the following fixes the error...

Code: [Select]
if(isset($splitted[1])) { // This is the IF clause that fixes the error
$results = explode('-',$splitted[1],2);
//Pagination has changed, removed the -1 note by Max Milbers NOTE: Works on j1.5, but NOT j1.7
// limitstart is swapped by joomla to start ! See includes/route.php
if ($start = $results[0]-1) $vars['limitstart'] = $start;
else $vars['limitstart'] = 0 ;
$vars['limit'] = (int)$results[1]-$results[0]+1;
} // end of If caluse