Hi David,
I'd like to add the product price to the title so the meta title will look like Product Name - Price - Site Name.
Here's the code I tried inside the /html/header.php file:
<title><?php if (isset($header["title"]) && $header["title"]) {echo $header["title"]." - " .$config_currencyHTML.$product["price"]. " - " .$config_title; } else {echo $config_title; } ?></title>
that doesn't work, so I guess I'm using the wrong price variable or maybe I need to declare it on the /html/header.php file?
Any Ideas?
Hi Lunen,
Rather than edit the header file, you can set the $header["title"] required in products.php itself.
In that file, the product page title is created by this code at line 64:
$header["title"] = htmlentities($q,ENT_QUOTES,$config_charset);
...so for the title you're after, have a go with:
$header["title"] = htmlentities($q,ENT_QUOTES,$config_charset)." - ".$config_currencyHTML.$product["products"][0]["price"]." - ".$config_title;
Hope this helps!
Cheers,
David.
--
PriceTapestry.com