Author Topic: Search module/plugi - one result found it redirects to flypage (don't want that)  (Read 4093 times)

tkgraphics

  • Beginner
  • *
  • Posts: 25
Hi,

I'm using VM 1.9 with the search module. when only one result is found, the results page redirects to the product's flypage. I do not want this. How can I change it, so the page looks the same as if there were 9 results, i.e. the browse style I've made?

Please please please help :)

-T

Venci Gentchev

  • Jr. Member
  • **
  • Posts: 153
    • Bulgarian Computer Store
administrator/components/com_virtuemart/html/shop.browse.php

This is the code you're looking for:
Code: [Select]
elseif( $num_rows == 1 && ( !empty($keyword) || !empty($keyword1) ) ) {
// If just one product has been found, we directly show the details page of it
$db_browse->query( $list );
$db_browse->next_record();
$flypage = $db_browse->sf("category_flypage") ? $db_browse->sf("category_flypage") : FLYPAGE;

$url_parameters = "page=shop.product_details&flypage=$flypage&product_id=" . $db_browse->f("product_id") . "&category_id=" . $db_browse->f("category_id");
vmRedirect( $sess->url($url_parameters, true, false ) );
}

Comment it, or simply change $num_rows from 1 to 10000:
Code: [Select]
elseif( $num_rows == 10000 && ( !empty($keyword) || !empty($keyword1) ) ) {
 :)
No pain, no gain, no site!