
Originally Posted by
greg_beyer
any guidance on editing the /includes/modules/meta_tags.php to add a new metatag would be appreciated. Thx
Using the template-override system (https://docs.zen-cart.com/user/templ.../#introduction), you would first copy /includes/modules/meta_tags.php to /includes/modules/YOUR_TEMPLATE/meta_tags.php, where YOUR_TEMPLATE is the name of the site's current template.
Next, you'd edit that template-override copy of a Zen Cart core-file, adding the highlighted section to the bottom of the file:
Code:
...
$zco_notifier->notify('NOTIFY_MODULE_META_TAGS_OVERRIDE', $metatag_page_name, $meta_tags_over_ride, $metatags_title, $metatags_description, $metatags_keywords);
// meta tags override due to 404, missing products_id, cPath or other EOF issues
if ($meta_tags_over_ride === true) {
zen_define_default('META_TAG_TITLE', $metatags_title);
zen_define_default('META_TAG_DESCRIPTION', $metatags_description);
zen_define_default('META_TAG_KEYWORDS', $metatags_keywords);
}
// -----
// Tell all search engines not to index the specified category (13 for this example)
//
if (isset($_GET['cPath']) && (int)$_GET['cPath'] === 13) {
?>
<meta name="robots" content="noindex">
<?php
}
// This should be last line of the script:
$zco_notifier->notify('NOTIFY_MODULE_END_META_TAGS');