Header Tags SEO by Jack York aka Jack_mcs - oscommerce-solution.com
Works with osCommerce Frozen version

Please read carefully and backup your files and database before adding.

This contribution allows a shop to have a unique title and meta tags 
for any page in the shop which is essential for having a shops pages 
listed well with the search engines. It also provides the option of 
adding category and manufacturer descriptions, using social bookmarks 
and optimizes many other parts of the shop for the search engines.

WANT IT DONE FOR YOU?
Order the installation and have Header Tags SEO installed and working
within 24 hours. This includes assistance with setting it up:
http://www.oscommerce-solution.com/header-tags-seo-p-122.html
Use the coupon code headertags_discount and save 10% off of the cost
of installation.

INSTALLATION:

NOTE: The Search Engine Frienly option in admin->Configuration must be off to use this conribution.

======================================================================================================
DATABASE CHANGES: Upload the included headertags_seo_install.php file to your root 
 directory (where your index.php file is located).  Then open your browser and type 
 in http://www.yoursite.com/headertags_seo_install.php (substitute your url, of
 course). 

======================================================================================================
NEW FILES TO ADD:

If you have not installed other addons into your shop, then upload all
of the files in both the catalog and catalog_only_new_files directories
to the same location in your shop and that will complete the installation.
If you have installed other addons or made other changes to the code, then 
you should only upload the files in the catalog_only_new_files directory 
and then make the following edits. 

PLEASE NOTE: The Bootstrap files change fairly often so the files included 
in this package may not match them. In that case, uploading the files could 
remove changes in the latest version of Bootstrap. If in doubt, perform 
the manual installation below.

FILE CHANGES:
======================================================================================================

In includes/languages/english/product_info.php, before the last ?>

ADD:

/*** Begin Header Tags SEO ***/ 
define('TEXT_VIEWING', 'Currently viewing:');
/*** End Header Tags SEO ***/  

===================================================================

In includes/languages/english.php, at the end of the file:

ADD:

/*** Begin Header Tags SEO ***/
define('BOX_HEADING_HEADERTAGS_TAGCLOUD', 'Popular Searches');
define('TEXT_SEE_MORE', 'see more');
define('TEXT_SEE_MORE_FULL', 'see more about %s');
define('HTS_OG_AVAILABLE_STOCK', 'Available Stock');
define('HTS_OG_PRICE', 'Price');
/*** End Header Tags SEO ***/

===================================================================

In includes/modules/product_listing.php,

FIND:

      $prod_list_contents .= '      </h2>';
    
ADD ABOVE:

    /*** Begin Header Tags SEO ***/
    $lc_add = '';
    $hts_listing_query = tep_db_query("select products_head_listing_text, products_description from products_description where products_id = " . (int)$listing['products_id'] . " and language_id = " . (int)$languages_id);
    if (tep_db_num_rows($hts_listing_query) > 0) {              
        $seeMore = '';
        switch (HEADER_TAGS_DISPLAY_SEE_MORE) {
            case 'off': break;
            case 'short': $seeMore = '...' . TEXT_SEE_MORE; break;
            case 'full': $seeMore = '...' . sprintf(TEXT_SEE_MORE_FULL, $listing['products_name']); break;
        }            
        $hts_listing = tep_db_fetch_array($hts_listing_query);
        if (tep_not_null($hts_listing['products_head_listing_text'])) {
            $lc_add .= '<br /><span class="hts_listing_text">' . $hts_listing['products_head_listing_text'] . '<a href="' . tep_href_link('product_info.php', ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . (int)$listing['products_id']) . '">' . $seeMore . '</a></span>';
        } else if (HEADER_TAGS_ENABLE_AUTOFILL_LISTING_TEXT == 'true') {
            $text = sprintf("%s...%s", substr(stripslashes(strip_tags($hts_listing['products_description'])), 0, 100), '<a href="' . tep_href_link('product_info.php', ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . (int)$listing['products_id']) . '">' . $seeMore . '</a>');
            $lc_add = '<br /><span class="hts_listing_text">' . $text . '</span>';
        }
    }     
    $prod_list_contents .= $lc_add;
    /*** End Header Tags SEO ***/       
    
===================================================================

In includes/application_top.php, 

FIND:

// add category names or the manufacturer name to the breadcrumb trail
  if (isset($cPath_array)) {
    $n=sizeof($cPath_array);
    for ($i=0; $i<$n; $i++) {      
      if ( defined('MODULE_HEADER_TAGS_CATEGORY_TITLE_SEO_BREADCRUMB_OVERRIDE') && (MODULE_HEADER_TAGS_CATEGORY_TITLE_SEO_BREADCRUMB_OVERRIDE == 'True') ) {
        $categories_query = tep_db_query("select coalesce(NULLIF(categories_seo_title, ''), categories_name) as categories_name from categories_description where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
      }
      else {
        $categories_query = tep_db_query("select categories_name from categories_description where categories_id = '" . (int)$cPath_array[$i] . "' and language_id = '" . (int)$languages_id . "'");
      }    
      if (tep_db_num_rows($categories_query) > 0) {
        $categories = tep_db_fetch_array($categories_query);
        $breadcrumb->add($categories['categories_name'], tep_href_link('index.php', 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
      } else {
        break;
      }
    }
  } elseif (isset($_GET['manufacturers_id'])) {
    if ( defined('MODULE_HEADER_TAGS_MANUFACTURER_TITLE_SEO_BREADCRUMB_OVERRIDE') && (MODULE_HEADER_TAGS_MANUFACTURER_TITLE_SEO_BREADCRUMB_OVERRIDE == 'True') ) {
      $manufacturers_query = tep_db_query("select coalesce(NULLIF(mi.manufacturers_seo_title, ''), m.manufacturers_name) as manufacturers_name from manufacturers m, manufacturers_info mi where m.manufacturers_id = mi.manufacturers_id and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and mi.languages_id = '" . (int)$languages_id . "'");
    }
    else {
      $manufacturers_query = tep_db_query("select manufacturers_name from manufacturers where manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'");
    } 
    if (tep_db_num_rows($manufacturers_query)) {
      $manufacturers = tep_db_fetch_array($manufacturers_query);
      $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link('index.php', 'manufacturers_id=' . $_GET['manufacturers_id']));
    }
  }

// add the products model to the breadcrumb trail
  if (isset($_GET['products_id'])) {    
    if ( defined('MODULE_HEADER_TAGS_PRODUCT_TITLE_SEO_BREADCRUMB_OVERRIDE') && (MODULE_HEADER_TAGS_PRODUCT_TITLE_SEO_BREADCRUMB_OVERRIDE == 'True') ) {
      $model_query = tep_db_query("select coalesce(NULLIF(pd.products_seo_title, ''), p.products_model) as products_model from products p, products_description pd where p.products_id = '" . (int)$_GET['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
    }
    else {
      $model_query = tep_db_query("select products_model from products where products_id = '" . (int)$_GET['products_id'] . "'");
    }
    if (tep_db_num_rows($model_query)) {
      $model = tep_db_fetch_array($model_query);
      $breadcrumb->add($model['products_model'], tep_href_link('product_info.php', 'cPath=' . $cPath . '&products_id=' . $_GET['products_id']));
    }
  }
  
REPLACE WITH:

/*** Begin Header Tags SEO ***/
// add category names or the manufacturer name to the breadcrumb trail
  if (isset($cPath_array)) {
    for ($i=0, $n=sizeof($cPath_array); $i<$n; $i++) {
      $categories_query = tep_db_query("select IF(categories_htc_breadcrumb_text !='', categories_htc_breadcrumb_text, categories_name) as title from categories_description where categories_id = " . (int)$cPath_array[$i] . " and language_id = " . (int)$languages_id);
      if (tep_db_num_rows($categories_query) > 0) {
        $categories = tep_db_fetch_array($categories_query);
        $breadcrumb->add($categories['title'], tep_href_link('index.php', 'cPath=' . implode('_', array_slice($cPath_array, 0, ($i+1)))));
      } else {
        break;
      }
    }
  } elseif (isset($_GET['manufacturers_id'])) {
    $manufacturers_query = tep_db_query("select IF(mi.manufacturers_htc_breadcrumb_text !='',mi.manufacturers_htc_breadcrumb_text, m.manufacturers_name) as title from manufacturers m left join manufacturers_info mi on m.manufacturers_id=mi.manufacturers_id where m.manufacturers_id= " . (int)$_GET['manufacturers_id'] . " AND languages_id = " . (int)$languages_id);
    if (tep_db_num_rows($manufacturers_query)) {
      $manufacturers = tep_db_fetch_array($manufacturers_query);
      $breadcrumb->add($manufacturers['title'], tep_href_link('index.php', 'manufacturers_id=' . $_GET['manufacturers_id']));
    }
  }

 // add the products name to the breadcrumb trail
 if (isset($_GET['products_id'])) {
     if (HEADER_TAGS_BREADCRUMB_MODEL_OVERRIDE == 'true') {
         $products_query = tep_db_query("select p.products_model as model from products p left join products_description pd on p.products_id = pd.products_id where p.products_id = " . (int)$_GET['products_id'] . " and pd.language_id =" .  (int)$languages_id);
         if (tep_db_num_rows($products_query)) {
             $products = tep_db_fetch_array($products_query);          
             $title = $products['model'];
             $args = isset($_GET['reviews_id']) ? tep_get_all_get_params() : 'cPath=' . $cPath . '&products_id=' . $_GET['products_id'] ;
             $breadcrumb->add($title, tep_href_link(basename($_SERVER['SCRIPT_FILENAME']), $args));
         }      
     } else { 
         $addModel = false;
         $db_query = tep_db_query("select 1 from headertags where page_name = '" . tep_db_input(basename($_SERVER['SCRIPT_FILENAME'])) . "' and append_model=1");
         if (tep_db_num_rows($db_query)) {
             $addModel = true;
         }
         
         $products_query = tep_db_query("select IF(pd.products_head_breadcrumb_text !='', pd.products_head_breadcrumb_text,pd.products_name) as title, p.products_model as model from products p left join products_description pd on p.products_id = pd.products_id where p.products_id = " . (int)$_GET['products_id'] . " and pd.language_id =" .  (int)$languages_id);
         if (tep_db_num_rows($products_query)) {
             $products = tep_db_fetch_array($products_query);          
             $title = ($addModel && tep_not_null($products['model']) ? $products['model'] . ' - ' . $products['title'] : $products['title']);
             $args = isset($_GET['reviews_id']) ? tep_get_all_get_params() : 'cPath=' . $cPath . '&products_id=' . $_GET['products_id'] ;
             $breadcrumb->add($title, tep_href_link(basename($_SERVER['SCRIPT_FILENAME']), $args));
         }
     }    
  }
/*** End Header Tags SEO ***/
   
===================================================================

In includes/footer.php, 

FIND:

  </div>
</footer>

ADD ABOVE:

 <?php
/*** Begin Header Tags SEO ***/
if (HEADER_TAGS_DISPLAY_TAG_CLOUD == 'true') {
    echo '<div id="hts_footer">';
    include('includes/headertags_seo_tagcloud_footer.php');
    echo '</div>';
}
/*** End Header Tags SEO ***/
?>  

===================================================================

In includes/template_top.php,

FIND:

<title><?php echo tep_output_string_protected($oscTemplate->getTitle()); ?></title>

REPLACE WITH:

<?php
/*** Begin Header Tags SEO ***/
if ( file_exists('includes/header_tags.php') ) {
  include('includes/header_tags.php');
} else {
?>
  <title><?php echo tep_output_string_protected($oscTemplate->getTitle()); ?></title>
<?php
}
/*** End Header Tags SEO by oscommerce-solution.com ***/
?>
?>

===================================================================
In includes/classes/category_tree.php,

FIND:

        $categories_query = tep_db_query("select c.categories_id, c.parent_id, c.categories_image, cd.categories_name, cd.categories_description, cd.categories_seo_description, cd.categories_seo_keywords, cd.categories_seo_title from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id. "' order by c.parent_id, c.sort_order, cd.categories_name");

REPLACE WITH: 

        /*** Begin Header Tags SEO ***/
        $cat_name = " IF(cd.categories_htc_title_tag_alt != '',cd.categories_htc_title_tag_alt,cd.categories_htc_title_tag) as categories_name, ";
        $cat_desc = " IF(cd.categories_htc_description != '',categories_htc_description,cd.categories_description) as categories_description ";
        
        $categories_query = tep_db_query("select c.categories_id, c.parent_id, c.categories_image, " . $cat_name . $cat_desc . " from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id. "' order by c.parent_id, c.sort_order, cd.categories_name");
        /*** End Header Tags SEO ***/

===================================================================
In advanced_search_result.php (three changes)

FIND:

  $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link('advanced_search.php'));

ADD ABOVE:
  
 /*** Begin Header Tags SEO ***/ 
  if (HEADER_TAGS_STORE_KEYWORDS == 'true') {
      require(DIR_WS_MODULES . 'header_tags_keywords.php');
  }
  /*** End Header Tags SEO ***/ 

FIND:

  $from_str = "from products p left join manufacturers m using(manufacturers_id) left join specials s on p.products_id = s.products_id";

REPLACE WITH: (note: the aove line is unchanged. It has code added above and below):

  /*** Begin Header Tags SEO ***/ 
  if (HEADER_TAGS_SEARCH_KEYWORDS == 'true') {
    $select_str .= ", hts.keyword ";
  }
  /*** End Header Tags SEO ***/ 
  
  $from_str = "from products p left join manufacturers m using(manufacturers_id) left join specials s on p.products_id = s.products_id";

  /*** Begin Header Tags SEO ***/ 
  if (HEADER_TAGS_SEARCH_KEYWORDS == 'true') {
     $from_str .= " left join headertags_search hts on p.products_id = hts.product_id ";  
  }
  /*** END Header Tags SEO ***/ 

FIND:

          $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";

ADD BENEATH:

          /*** Begin Header Tags SEO ***/
          if (HEADER_TAGS_SEARCH_KEYWORDS == 'true') {
            $where_str .= " or hts.keyword like '%" . tep_db_input($keyword) . "%'";
          }
          if (HEADER_TAGS_ENABLE_ADDITIONAL_WORDS == 'true') {
            $where_str .= " or pd.products_head_additional_words like '%" . tep_db_input($keyword) . "%'";
          }           
          /*** End Header Tags SEO ***/
      
  
===================================================================

In index.php

FIND:

    $category_query = tep_db_query("select cd.categories_name, c.categories_image, cd.categories_description from categories c, categories_description cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

REPLACE WITH:

    /*** Begin Header Tags SEO ***/
    $category_query = tep_db_query("select cd.categories_name, c.categories_image, IF(cd.categories_htc_title_tag_alt != '',cd.categories_htc_title_tag_alt,cd.categories_htc_title_tag) as categories_htc_title_tag, cd.categories_htc_description from categories c, categories_description cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
    /*** end Header Tags SEO ***/

FIND:

  <h1><?php echo $category['categories_name']; ?></h1>

REPLACE WITH:

  <h1><?php echo $category['categories_htc_title_tag']; ?></h1>

FIND:

<div class="contentContainer">
  <div class="row">
    <?php echo $oscTemplate->getContent('index_nested'); ?>


ADD ABOVE:

<?php 
/*** Begin Header Tags SEO ***/ 
if (tep_not_null($category['categories_htc_description'])) { 
   echo '<div class="well well-sm"><h2 style="text-decoration:none;">' . $category['categories_htc_description'] . '</h2></div>';
} 
/*** End Header Tags SEO ***/ 
?>


FIND:

    $catname = HEADING_TITLE;
    if (isset($_GET['manufacturers_id']) && !empty($_GET['manufacturers_id'])) {
      $image = tep_db_query("select m.manufacturers_image, m.manufacturers_name as catname, mi.manufacturers_description as catdesc from manufacturers m, manufacturers_info mi where m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'");
      $image = tep_db_fetch_array($image);
      $catname = $image['catname'];
    } elseif ($current_category_id) {
      $image = tep_db_query("select c.categories_image, cd.categories_name as catname, cd.categories_description as catdesc from categories c, categories_description cd where c.categories_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
      $image = tep_db_fetch_array($image);
      $catname = $image['catname'];
    }
?>

<div class="page-header">
  <h1><?php echo $catname; ?></h1>
</div>

<?php
if (tep_not_null($image['catdesc'])) {
  echo '<div class="well well-sm">' . $image['catdesc'] . '</div>';
}
?>

REPLACE WITH:

    /*** Begin Header Tags SEO ***/
    if (isset($_GET['manufacturers_id']) && !empty($_GET['manufacturers_id'])) {
      $image = tep_db_query("select m.manufacturers_image, m.manufacturers_name as catname, mi.manufacturers_description as catdesc from manufacturers m, manufacturers_info mi where m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "' and m.manufacturers_id = mi.manufacturers_id and mi.languages_id = '" . (int)$languages_id . "'");
      $image = tep_db_fetch_array($image);
      $db_query = tep_db_query("select IF(manufacturers_htc_title_tag_alt != '',manufacturers_htc_title_tag_alt, manufacturers_htc_title_tag) as htc_title, manufacturers_htc_description as htc_description from manufacturers_info where languages_id = '" . (int)$languages_id . "' and manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
    } elseif ($current_category_id) {
      $image = tep_db_query("select c.categories_image, cd.categories_name as catname, cd.categories_description as catdesc from categories c, categories_description cd where c.categories_id = '" . (int)$current_category_id . "' and c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "'");
      $image = tep_db_fetch_array($image);
      $db_query = tep_db_query("select IF(categories_htc_title_tag_alt != '',categories_htc_title_tag_alt, categories_htc_title_tag) as htc_title, categories_htc_description as htc_description from categories_description where categories_id = '" . (int)$current_category_id . "' and language_id = '" . (int)$languages_id . "'");
    }
    $htc = tep_db_fetch_array($db_query);
?>

<div class="page-header">
  <h1><?php echo $htc['htc_title']; ?></h1>
</div>
    <?php /*** End Header Tags SEO ***/ ?>


FIND:

    include('includes/modules/product_listing.php');
?>

</div>

REPLACE WITH:

    /*** Begin Header Tags SEO ***/ 
    if (tep_not_null($htc['htc_description'])) { 
         echo '<h2 style="text-decoration:none;">'. $htc['htc_description'] . '</h2>';
     }
    /*** End Header Tags SEO ***/ 
    include('includes/modules/product_listing.php');
?>

</div>
    <!--- BEGIN Header Tags SEO Social Bookmarks -->
    <?php if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true') {
      echo '<div style="margin-top:5px; float:right;">';
      include('includes/modules/header_tags_social_bookmarks.php');
      echo '</div>';    }
    ?>
    <!--- END Header Tags SEO Social Bookmarks -->

FIND:

  <?php echo $oscTemplate->getContent('index'); ?>
</div>

ADD BENEATH:

<?php
    
    //<!--- Begin Header Tags SEO Home Page Text and Social Bookmarks -->
    if (tep_not_null($header_tags_array['home_page_text'])) {
        echo '<div>';
        echo '<div style="padding:10px 0;">' . $header_tags_array['home_page_text'] . '</div>';
        echo '</div>';
    }

    if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true') {
        echo '<div>';
        include('includes/modules/header_tags_social_bookmarks.php'); 
        echo '</div>';
    }
    //<!--- END Header Tags SEO Home Page Text and Social Bookmarks -->
    ?>
       
===================================================================
In includes/modules/content/index_nested/templates/category_listing.php

FIND:

      $cPath_new = tep_get_path($categories['categories_id']);
      echo '<div class="col-sm-' . $category_width . '">';
      echo '  <div class="text-center">';
      echo '    <a href="' . tep_href_link('index.php', $cPath_new) . '">' . tep_image('images/' . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>';
      echo '    <div class="caption text-center">';
      echo '      <h5><a href="' . tep_href_link('index.php', $cPath_new) . '"><span itemprop="itemListElement">' . $categories['categories_name'] . '</span></a></h5>';
      echo '    </div>';

REPLACE WITH:

      $cPath_new = tep_get_path($categories['categories_id']);
      /*** Begin Header Tags SEO ***/ 
      $htsDesc = '';
      if (HEADER_TAGS_DISPLAY_CATEGORY_SHORT_DESCRIPTION !== 'Off' && tep_not_null($categories['hts_desc'])) {
          $lgth = (int)HEADER_TAGS_DISPLAY_CATEGORY_SHORT_DESCRIPTION;
          $htsDesc = '<br>';
          if (isset($categories['hts_desc'][$lgth])) { 
              $htsDesc .= substr($categories['hts_desc'], 0, ($lgth - 3)) . '<span class="hts_listing_see_more">...' . TEXT_SEE_MORE . '</span>';
          } else {    
              $htsDesc .= $categories['hts_desc'];
          }
      }    
      echo '<div class="col-sm-' . $category_width . '">';
      echo '  <div class="text-center">';
      echo '    <a href="' . tep_href_link('index.php', $cPath_new) . '">' . tep_image('images/' . $categories['categories_image'], $categories['categories_name'], SUBCATEGORY_IMAGE_WIDTH, SUBCATEGORY_IMAGE_HEIGHT) . '</a>';
      echo '    <div class="caption text-center">';
      echo '      <h5><a href="' . tep_href_link('index.php', $cPath_new) . '"><span itemprop="itemListElement">' . $categories['categories_name'] .  $htsDesc . '</span></a></h5>';
      echo '    </div>';
      /*** End Header Tags SEO ***/ 

FIND THE LAST

</div>      

ADD ABOVE:

<!--- BEGIN Header Tags SEO Social Bookmarks -->
<?php if (FALSE && HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true') {
   echo '<div style="margin-top:5px; float:right;">';
   include('includes/modules/' . 'header_tags_social_bookmarks.php');
   echo '</div>';
 } 
?>
<!--- END Header Tags SEO Social Bookmarks -->

===================================================================
In includes/modules/content/index_nested/templates/category_new_products.php

FIND THE LAST

</div>      

ADD ABOVE:

<!--- BEGIN Header Tags SEO Social Bookmarks -->
<?php if (FALSE && HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true') {
   echo '<div style="margin-top:5px; float:right;">';
   include('includes/modules/' . 'header_tags_social_bookmarks.php');
   echo '</div>';
 } 
?>
<!--- END Header Tags SEO Social Bookmarks -->

===================================================================
In products_info.php

FIND:

  require(DIR_WS_INCLUDES . 'template_top.php');

ADD BENEATH:
  
  /*** Begin Header Tags SEO ***/  
  echo "<a name=\"\$header_tags_array['title']\"></a>";
  /*** End Header Tags SEO ***/ 

FIND:

    $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_gtin from products p, products_description pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
    $product_info = tep_db_fetch_array($product_info_query);

    tep_db_query("update products_description set products_viewed = products_viewed+1 where products_id = '" . (int)$_GET['products_id'] . "' and language_id = '" . (int)$languages_id . "'");

REPLACE WITH:

    /*** Begin Header Tags SEO ***/
    $product_info_query = tep_db_query("select p.products_id, pd.products_name, pd.products_description, p.products_model, p.products_quantity, p.products_image, pd.products_url, p.products_price, p.products_tax_class_id, p.products_date_added, p.products_date_available, p.manufacturers_id, p.products_gtin, pd.products_head_sub_text from products p, products_description pd where p.products_status = '1' and p.products_id = '" . (int)$_GET['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
    $product_info = tep_db_fetch_array($product_info_query);
    $product_info['products_name'] = $header_tags_array['title_alt'];
    /*** End Header Tags SEO ***/ 

    tep_db_query("update products_description set products_viewed = products_viewed+1 where products_id = '" . (int)$_GET['products_id'] . "' and language_id = '" . (int)$languages_id . "'");
      
===================================================================
In user.css

Find:

/* user.css ----------------------------------------------------------------- */

ADD BENEATH:

@import url("headertags_seo_styles.css");

======================================================================================================
NOTES:
If you want to use the Page Top option, there are two ways to do that:

1 - Go to admin->Modules->Content and install the "Header Tags Page Top"
    module. 

2 - Install the Navigation Bar module after making the changes included with 
    this version. If your Navigation Bar files have not been altered, you 
    can just overwrite them with the included ones.

Both of the above accomplish the same thing but the second will look better
if you use that module. 

======================================================================================================
The catalog section should now be installed and working!  However, if the admin
section has not been installed, some page headings may be missing. This is just
temporary and, in fact, shows that the installation is working so far. :) You
should proceed to the Install_Admin.txt file, after making note of the following.

===========================================================================================
NOTES:

The bookmarks code can be added to any page by inserting the following anywhere on the page.
To have it display properly, it should generally be inserted after a </div>.

<!--- BEGIN Header Tags SEO Social Bookmarks -->
<?php if (HEADER_TAGS_DISPLAY_SOCIAL_BOOKMARKS == 'true')
 include('includes/modules/header_tags_social_bookmarks.php');
?>
<!--- END Header Tags SEO Social Bookmarks -->

===========================================================================================
TROUBLESHOOTING:

To allow the admin section to access the includes/header_tags.php file, the
permissions for that file should be set to 755 (777 on some hosts). The best way
to be sure to get the settings correct is to check the settings on the images
directory and set the ones for the Header Tags file to match those. If the
settings on the images directory and the Header Tags file are different, a
warning will appear in admin->Header Tags SEO. If that warning persists even
though the code works, there is an option to turn it off in
admin->Configuration->Header Tags. But if the changes you make in Header Tags
don't stick, then turing that option off will only hide the problem.

If you are still having problems, go to admin->Header Tags SEO->Test and click
on the button on that page. That will display any failures found in the
installation. No errors should be found, except, possibly, the permissions error
(see above regarding permissions). If you get a failure and cannot figure it out, 
post that error in the support thread for the contribution. Questions about failures
without posting the results of the test will be answered by telling you to run 
the test, so please do that first.

************************************ SUPPORT *************************************
If you have any problems, see the troubleshooting sections in either of the Install
files or the test routine in admin->Header Tags SEO before asking in the support 
thread at

http://forums.oscommerce.com/topic/298099-header-tags-seo

************************** IMPORTANT *********************************
If you post a problem in the support thread, be sure to mention the version
of the shop you are using. Otherwise, you post may not get answered or it 
may be delayed while you find the needed version.
************************** IMPORTANT *********************************

Free support questions will not be answered if you PM me or contact me through 
my web site so please do not do so.


======================================================================================================


