Support forum login

©2006-2012 IAAI Software

Contact Us Privacy Policy

A better seo title than merchant::merchant

Submitted by magnaromagna on Fri, 2009-09-25 14:12.

Hello,
is it possible to change the title for the merchant urls from (example)

merchant:"name of merchant"

to

"Products for merchant "name of merchant"?

Thank you in advance

Submitted by support on Fri, 2009-09-25 14:23.

Hi,

Sure - the title is set by the following code on line 154 of search.php:

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

...so to set a special title for merchant results, REPLACE the above code with:

    if ($parts[0]=="merchant")
    {
      $header["title"] = "Products from merchant ".$parts[1];
    }
    else
    {
      $header["title"] = htmlentities($q,ENT_QUOTES,$config_charset);
    }

Cheers,
David.

Submitted by magnaromagna on Fri, 2009-09-25 23:05.

Perfect, thanks.

And to make the same change in the search.php result page, when it says "search results for merchant:XXX ... relevance..."

? Thank you in advance

Submitted by support on Sat, 2009-09-26 09:23.

Hi,

That is set by this code on line 118:

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

...so for a different version for merchant:

    if ($parts[0]=="merchant")
    {
      $banner["h2"] = translate("Product search results for merchant ")." <strong>".$parts[1]."</strong>&nbsp;";
    }
    else
    {
      $banner["h2"] = translate("Product search results for")." <strong>".htmlentities($q,ENT_QUOTES,$config_charset)."</strong>&nbsp;";
    }

Cheers,
David.

Submitted by magnaromagna on Sat, 2009-10-24 20:11.

Thank, work fine.

Another similar question: to make the same change for "brand" page?

Submitted by support on Sat, 2009-10-24 20:16.

Hi,

To extend this mod to other search operators it would be best to replace the above modification with a switch statement; for example:

    switch($parts[0])
    {
      case "merchant":
        $banner["h2"] = translate("Product search results for merchant ")." <strong>".$parts[1]."</strong>&nbsp;";
        break;
      case "category":
        $banner["h2"] = translate("Product search results for category ")." <strong>".$parts[1]."</strong>&nbsp;";
        break;
      case "brand":
        $banner["h2"] = translate("Product search results for brand ")." <strong>".$parts[1]."</strong>&nbsp;";
        break;
      default:
        $banner["h2"] = translate("Product search results for")." <strong>".htmlentities($q,ENT_QUOTES,$config_charset)."</strong>&nbsp;";
        break;
    }

I've added the category case in addition to brand in the above...

Hope this helps!

Cheers,
David.

Submitted by magnaromagna on Sun, 2009-11-22 08:43.

Thank you David for support.

I see that in site/category/name-of-product.html the title is "category:name fo product". To modify this (I like to translate the "category" in my language) the file is the same?

Submitted by support on Sun, 2009-11-22 13:50.

Hi,

That page is generated by search.php and the title is set to the query; so to change this, look for the following around line 154:

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

...and REPLACE this with:

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

...and then it will use your translation for "category" from the translation file.

Hope this helps!

Cheers,
David.

Submitted by magnaromagna on Tue, 2009-12-15 11:16.

Thank David for all suggestion.

I'm quite confused: I made all modifications, but in
site.ext/brand/CASIO/ for example,
the title is "brand:casio", but I prefer something like "Products for brand casio". Need another modification or I did not put the right code?
Thank again

Submitted by support on Tue, 2009-12-15 13:05.

Hi,

If you could perhaps email me your modified search.php and also html/header.php i'll check it all out for you...!

Cheers,
David.

Submitted by magnaromagna on Tue, 2010-04-13 20:35.

Hello David
I see in Google Webmaster Tool that there is a duplicate title problem. I mean the same title "name of product bla bla" for all pages of a category

/pt/category/nameofproduct/1.html
/pt/category/nameofproduct/2.html
/pt/category/nameofproduct/3.html

Is possible to add "page 1", "page 2", etc?

Thank you again

Submitted by magnaromagna on Tue, 2010-04-13 20:38.

I was forgotten. Same duplicate problem with searches like theese

/search.php?q=Battery+SGH+e330n&page=1&sort=priceAsc
/search.php?q=Battey+SGH+e330n&page=1&sort=priceDesc
/search.php?q=Battey+SGH+e330n&page=1&sort=rating

etc. How to solve this? With canonical tag declaration in the header?

Submitted by support on Wed, 2010-04-14 06:53.

Hi,

So sorry I missed your post - yes this can be done. In your search.php you'll find where the title is set by this code around about line 154:

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

So to add page (if > 1), and the sort order (if not default), REPLACE the above code with:

    $header["title"] = htmlentities($q,ENT_QUOTES,$config_charset);
    if ($_GET["page"]) $header["title"] .= " | Page ".htmlentities($_GET["page"],ENT_QUOTES,$config_charset);
    if ($_GET["sort"]) $header["title"] .= " | ".htmlentities($_GET["sort"],ENT_QUOTES,$config_charset);

Hope this helps!

Cheers,
David.

Submitted by magnaromagna on Wed, 2010-04-14 09:29.

Thanks David,
afther changes I received this error:

Parse error: syntax error, unexpected T_IF in /../search.php on line 356

I forgotten to say that I have this structure, sorry:

switch($parts[0])
{
case "merchant":
$header["title"] = "Products ".$parts[1];
break;

case "category":
$header["title"] = "Category ".$parts[1];
break;

case "brand":
$header["title"] = "Brand ".$parts[1];
break;

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

Is possible to put the "page" in all cases?

Submitted by support on Wed, 2010-04-14 09:35.

Hi,

Sorry about that - i'd missed a ; out of the code. Sure - it can be applied to all cases - simply add the following 2 lines immediately after that block that you posted:

    if ($_GET["page"]) $header["title"] .= " | Page ".htmlentities($_GET["page"],ENT_QUOTES,$config_charset);
    if ($_GET["sort"]) $header["title"] .= " | ".htmlentities($_GET["sort"],ENT_QUOTES,$config_charset);

Cheers,
David.

Submitted by magnaromagna on Wed, 2010-04-14 10:01.

Works fine thanks!

And for duplicate problem the solution is the one posted at http://www.pricetapestry.com/node/2621 ?

Submitted by support on Wed, 2010-04-14 10:08.

Hi,

Yes - that should work fine!

Cheers,
David.

Submitted by transparencia on Tue, 2010-10-12 20:56.

And what about the titles in the merchant/, brand/ and categories/ index pages? How can we change it?

Submitted by support on Wed, 2010-10-13 07:57.

Hi,

In each of merchants.php, categories.php and brands.php look for the following code towards the end:

  require("html/header.php");

..and REPLACE that with:

  $header["title"] = "Page Title Here";
  require("html/header.php");

Hope this helps!

Cheers,
David.
--
PriceTapestry.com