You are here:  » URL query for price range

Support Forum



URL query for price range

Submitted by clare on Tue, 2010-12-14 14:54 in

Hi David

What is the url query required to show products between price a and price b. In my old installation I used search.php?q=price:0.00:5.00 that was with the old price mods extra that I used.

In the current version of search.php that I have downloaded I see that Minimum and maximum URL parameters are included and I am just trying to upgrade my files to the current version.

Submitted by support on Tue, 2010-12-14 14:58

Hi Clare,

For all products between 2 prices, use:

search.php?q=bw:&minPrice=0.00&maxPrice=5.00

(minPrice isn't actually required if 0.00 however, although it doesn't matter if it's there)

Cheers,
David.
--
PriceTapestry.com

Submitted by clare on Tue, 2010-12-14 15:30

Thanks, good to have the new features by the way, much appreciated.

Submitted by clare on Wed, 2010-12-15 11:48

Hi,
On my site I put the code
if (isset($header["title"]) && $header["title"]) {echo $header["title"]."

in some places in the html,so that when showing products from a certain merchant for example, the page will say "product Search Results for MERCHANT" and have the merchant name as its title. Same with search results.

When showing the price range results, it is showing "product search results for BW" and title of the page is BW etc.

I am wondering if it is possible to change that somehow?

Submitted by support on Wed, 2010-12-15 12:30

Hi Clare,

Sure - the banner text is set by this code at line 233 of search.php:

    $banner["h2"] = translate("Product search results for")." <strong>".htmlentities($q,ENT_QUOTES,$config_charset)."</strong>&nbsp;";

Try REPLACING that with:

    if ($parts[0] == "bw")
    {
      $title_q = "Price range ".$config_currencyHTML.$minPrice." to ".$config_currencyHTML.$maxPrice;
    }
    else
    {
      $title_q = htmlentities($q,ENT_QUOTES,$config_charset);
    }
    $banner["h2"] = translate("Product search results for")." <strong>".$title_q."</strong>&nbsp;";

And likewise for the page title, look for the following code at line 275:

    $header["title"] = htmlentities($q,ENT_QUOTES,$config_charset);

...and REPLACE that with:

    $header["title"] = $title_q;

Cheers,
David.
--
PriceTapestry.com

Submitted by clare on Wed, 2010-12-15 12:45

Thanks, yes that works perfectly.