You are here:  » Removing "Brand:"

Support Forum



Removing "Brand:"

Submitted by John12 on Sun, 2007-04-29 10:40 in

How do I remove "brand:" on the brand result pages like "brand:......"

Same for the H2 part "brand:"

And if possible the ":" behind the brand name

Submitted by support on Sun, 2007-04-29 11:14

Hi,

To remove it from the page title, see the mods in this thread:

http://www.pricetapestry.com/node/291

For the HT part, this is set on line 95 of search.php as follows:

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

Change this to the code below to remove the brand: (and merchant: tags etc.) from this part of the display:

    $h2 = $q; // this is what was originally displayed
    $h2 = str_replace("merchant:","",$h2);
    $h2 = str_replace("category:","",$h2);
    $h2 = str_replace("brand:","",$h2);
    $h2 = str_replace(":"," ",$h2);
    $banner["h2"] = translate("Product search results for")." <strong>".htmlentities($h2,ENT_QUOTES,$config_charset)."</strong>&nbsp;";

Hope this helps!
Cheers,
David.

Submitted by John12 on Sun, 2007-04-29 15:56

My PHP knowlegde is very very limited. I have no idea what I did, but it works. Thanks.

Submitted by knight01 on Fri, 2007-06-01 23:55

David,
Taking this a step further...
How can the terms category, brand etc. be removed from the title tag that displays at the top of the browser?

Submitted by support on Sat, 2007-06-02 07:01

Hi,

To do the same for the TITLE tag, in search.php look for the following code (line 131 in the distribution)...

    $header["title"] = $q;

...and change this as follows:

    $title = $q;
    $title = str_replace("merchant:","",$title);
    $title = str_replace("category:","",$title);
    $title = str_replace("brand:","",$title);
    $title = str_replace(":"," ",$title);
    $header["title"] = $title;

That should do the trick!
Cheers,
David.

Submitted by knight01 on Sun, 2007-06-03 03:10

That works! Thanks. Now if I can just find a way to match products more accurately... my kingdom for a sku in the datafeeds!

Perfume & Cologne Comparison Site

Submitted by philstone on Mon, 2010-10-11 13:18

hi david

how would i remove categories: etc from description and keywords? and include 'category name' in the search title bar?

thanks

phil

Submitted by support on Mon, 2010-10-11 13:26

Hi Phil,

In place of the above modification, rather than replacing category: etc. with nothing, have a go with:

    $title = $q;
    $title = str_replace("merchant:","Merchant name ",$title);
    $title = str_replace("category:","Category name ",$title);
    $title = str_replace("brand:","Brand name ",$title);
    $title = str_replace(":"," ",$title);
    $header["title"] = $title;

Cheers,
David.
--
PriceTapestry.com

Submitted by transparencia on Tue, 2010-10-12 00:24

By the way, is it possible to completely remove the "brand:", "category:", "merchant:" from the Search bar and run everything normally?

Submitted by support on Tue, 2010-10-12 08:18

Hi,

I wouldn't recommend that I'm afraid as it would make the search results inconsistent with what is actually displayed. The alternative of course is not to populate the search box which can be done by removing the following section from line 3 of html/searchform.php

value='<?php print (isset($q)?$q:""); ?>'

Cheers,
David.
--
PriceTapestry.com