Hi Dave
How can I change "merchant" in title, as it appears in the seach results below like this:
merchant:Freemans Catalogue:
Comparison search results for merchant:Freemans Catalogue: (showing 1 to 12 of 7192). Order by: Relevance, Product Rating | Price: Low to High, High to Low ...
Cheers Doug C
David,
How/where can I do the same for "category"? And how/where can I change the text ("merchant:" and "category:") which shows in the search box?
Cheers, IG
Hi,
To make the same change for category, simply follow exactly as above but change "merchant:" to "category:". Alternatively, if you want to do both (and brand as well), then instead of:
$temp = str_replace("merchant:","",$temp);
Use:
$temp = str_replace(array("merchant:","category:","brand:"),"",$temp);
With regards to modifying what is displayed in the search box, I would not recommend this as it would break the link between what is in the search box and what is currently displayed. If you really want to do this let me know; but in most cases the resulting text would return no results if it was actually searched on...
Cheers,
David.
Thanks David, I made the changes.
I think I have to be more specific concerning the search box. What I would like to do is to show the text "shop:" instead of "merchant:". You helped me make this work in the past (http://www.pricetapestry.com/node/28 > scroll to the bottom), but it seems that this hack is not working anylonger.
Cheers, IG
Hiya,
The changes in this thread:
http://www.pricetapestry.com/node/1496
...should have changed merchant: to shop: everywhere, including the search box...
Cheers,
David.
I replaced all "merchant:" with "shop:" as explained in that thread, but it is still showing "merchant:" in the search box.
Really strange...
David,
I figured it all out. I forgot to change "..q=merchant" to "...q=shop" in the .htaccess. Well, actually I was not aware that this part has to be changed as well.
Thanks again for your help!
Cheers, Ivo
PS: Your support and speed is still one of a kind!
Hi Doug,
The merchant: appears in that section because it displays exactly what the query was (e.g. merchant:, brand: etc.). This is set by the following code on line 135 of search.php:
$banner["h2"] = translate("Product search results for")." <strong>".htmlentities($q,ENT_QUOTES,$config_charset)."</strong> ";
If you want to remove merchant:, simply make a copy of $q into a temporary variable ($temp), use str_replace() to make any changes you require, and then use $temp in place of $q in the above code. For example, replace the above line with:
$temp = $q;
$temp = str_replace("merchant:","",$temp);
$banner["h2"] = translate("Product search results for")." <strong>".htmlentities($temp,ENT_QUOTES,$config_charset)."</strong> ";
See the following thread for similar code to remove merchant: etc. from the page title:
http://www.pricetapestry.com/node/291
Hope this helps!
Cheers,
David.