RE: Meta Tags / Titles for product and catagory pages. SEO

benjaim77 <[email protected]> 21 Aug 2003 15:30:28 -0000
Newsgroups gmane.comp.web.oscommerce.suggestions
Message-ID <8fee14411a927f5547ea95da19233af5@osCommerce-Forums>
This message was sent from: Suggestions and Proposals
http://forums.oscommerce.com/viewtopic.php?p=217403#217403
----------------------------------------------------------------

Add this code snippet to your porductsinfo.php page

<?php
$title_query = tep_db_query("select  pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
    $prod_title = tep_db_fetch_array($title_query);
  $newtitle = $prod_title['products_name'];
?>

then set your title tag to this

<title><?php echo $newtitle; ?></title>

now your products name will appear in the title tag of your page

I'll post more later, I am in the midst of settign one of these carts up, and it has to be 100% search engine friendly