I want to use the uploaded keyword tags from the feeds on the product page, how can this be done?
Great that add a new field topic has pased me, i didnt had saw it yet, so this opens a NEW world to this brilliant script.
Thank you for your excelent support, will try it.
Hi
first part is ok.
my main problem now is the header.php
im using a buyed template (revolution) i bought.
<?php if (isset($header["meta"])): foreach($header["meta"] as $name => $content): ?>
<meta name='<?php print $name; ?>' content='<?php print $content; ?>' />
<?php endforeach; endif; ?>
can you help me on that too?
Hi,
To use your new keywords field as the keywords meta tag, rather than edit html/header.php, make the change in products.php where the meta tags are set (header.php just displays whatever has been set by the main script).
In products.php look for the following code on line 54:
$header["meta"]["keywords"] = htmlentities($q,ENT_QUOTES,$config_charset);
...and REPLACE with:
$header["meta"]["keywords"] =
htmlentities($product["products"][0]["keywords"],ENT_QUOTES,$config_charset);
That should do the trick...
Cheers,
David.
Hi Dave
Is there a way to do both ways together on the keywords?
Thank You
Dean
Hello Dean,
Sure - best way is probably to make the use of keywords field conditional (assuming it is not populated for all products) and then append to the normal version, for example:
$header["meta"]["keywords"] = htmlentities($q,ENT_QUOTES,$config_charset);
if ($product["products"][0]["keywords"])
{
$header["meta"]["keywords"] .= " ".
htmlentities($product["products"][0]["keywords"],ENT_QUOTES,$config_charset);
}
Cheers,
David.
Hi David
When I tried this I got an error. Also I was hoping that I could show both together at the same time if possible.
Thank You
Dean
Hi,
If you haven't done so already; first add a "keywords" field to your site (so that you can import it. Full details for adding a new field are in the following thread:
http://www.pricetapestry.com/node/3094
With that in place, and the "keywords" field being imported; edit products.php and look for the following code on line 54:
$header["meta"]["keywords"] = htmlentities($q,ENT_QUOTES,$config_charset);
...and REPLACE with:
$header["meta"]["keywords"] =
htmlentities($product["products"][0]["keywords"],ENT_QUOTES,$config_charset);
Hope this helps!
Cheers,
David.