You are here:  » Comparison by default

Support Forum



Comparison by default

Submitted by jvd88 on Sun, 2009-04-26 19:16 in

Hi again,

Another question, is it possible to give an option to show products that were found from different vendors,
with different prices ?
Pure as a option. So not always.

Something like; Show only comperason products

Greetz,

Joep

Submitted by support on Mon, 2009-04-27 08:09

Hello Joep,

Sure - here is something to try to see if it gives the results you want. In search.php, look for the following code starting at line 105:

    if (isset($orderBySelection[$sort]))
    {
      $sql .= " ORDER BY ".$orderBySelection[$sort];
    }

...and REPLACE this with:

    if ($_GET["compareOnly"])
    {
      $sql = str_replace("GROUP","AND numMerchants > 1 GROUP",$sql);
      $sqlResultCount .= " AND numMerchants > 1";
    }
    if (isset($orderBySelection[$sort]))
    {
      $sql .= " ORDER BY ".$orderBySelection[$sort];
    }

Then, to add a link above the search results (for now), look for the following code on line 189:

      require("html/searchresults.php");

...and REPLACE this with:

      print "<p><a href='".$config_baseHREF."search.php?q=".urlencode($q)."&sort=".$sort."&compareOnly=1'>Compare Only</a></p>";
      require("html/searchresults.php");

Cheers,
David.

Submitted by jvd88 on Mon, 2009-04-27 08:25

I get a mysql error.

goto the top menu:

{link saved}

compare only

Joep

Submitted by jvd88 on Mon, 2009-04-27 08:26

Oh.. and it would be nice to also keep the other options, low to high and so.

Submitted by jvd88 on Mon, 2009-04-27 08:28

and all the categories are gone too, when browsing by one shop.

Submitted by support on Mon, 2009-04-27 08:35

Hi Joep,

The sort order will be kept; but my apologies the replacement SQL is not valid on a summary field; so I will have to work out another way to achieve this - bear with me and I will try it out on my test server...

Cheers,
David.

Submitted by jvd88 on Mon, 2009-04-27 08:57

No problem.. i will replace it with the old one, for the time being.
You know what i meant about the Winkel (store) the categories are gone, when you select a store.