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
My PHP knowlegde is very very limited. I have no idea what I did, but it works. Thanks.
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?
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.
That works! Thanks. Now if I can just find a way to match products more accurately... my kingdom for a sku in the datafeeds!
hi david
how would i remove categories: etc from description and keywords? and include 'category name' in the search title bar?
thanks
phil
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
By the way, is it possible to completely remove the "brand:", "category:", "merchant:" from the Search bar and run everything normally?
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
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> ";
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> ";
Hope this helps!
Cheers,
David.