Contributions
Show Product Name In Page Title
SHOW PRODUCT NAME IN PAGE TITLE
Here's a simple mod to make the product name show up in the page title.
Ideal for giving your products better search engine optimization.
Super-easy modification. 30 seconds at most. One line of code.
Expand All / Collapse All
sorry here the right string:
<title><?php echo $products_name . ' [ ' . $products_model . ' ] - ' . TITLE; ?></title>
Add manufacturer or what ever by selecting the right DB (Manufacturer) and add: . $manufacturers_name . to the string
<title><?php echo $products_name . ' [ ' . $products_model . ' ] - ' . $title; ?></title>
Add manufacturer or what ever by selecting the right DB (Manufacturer) and add: . $manufacturers_name . to the string
** Forgot to define $products_model --- sorry **
Add this just below it:
<?php
$product_info_query = tep_db_query("select pd.products_name, p.products_model 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 . "'");
$product_info = tep_db_fetch_array($product_info_query);
$products_model = $product_info['products_model'];
$products_name = $product_info['products_name'];
?>
** This Version shows: PRODUCT_NAME [ PRODUCT_MODEL ] TITLE
Look for this in product_info.php
$product_check_query = tep_db_query("select count(*) as total 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 . "'");
$product_check = tep_db_fetch_array($product_check_query);
?>
Add this just below it:
<?php
$product_info_query = tep_db_query("select pd.products_name, p.products_model 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 . "'");
$product_info = tep_db_fetch_array($product_info_query);
$products_name = $product_info['products_name'];
?>
Look for this line:
<title><?php echo TITLE; ?></title>
And change it to:
<title><?php echo $products_name; ?> [ <?php echo $products_model; ?> ] - <?php echo TITLE; ?></title>
Sorry, I forgot to state the original TITLE tag below. This is the new one that works...
Look for this in product_info.php
$product_check_query = tep_db_query("select count(*) as total 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 . "'");
$product_check = tep_db_fetch_array($product_check_query);
?>
Add this just below it:
<?php
$product_info_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 . "'");
$product_info = tep_db_fetch_array($product_info_query);
$products_name = $product_info['products_name'];
?>
Look for this line:
<title><?php echo TITLE; ?></title>
And change it to:
<title><?php echo TITLE; ?> - <?php echo $products_name; ?></title>
Look for this in product_info.php
$product_check_query = tep_db_query("select count(*) as total 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 . "'");
$product_check = tep_db_fetch_array($product_check_query);
?>
Add this just below it:
<?php
$product_info_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 . "'");
$product_info = tep_db_fetch_array($product_info_query);
$products_name = $product_info['products_name'];
?>
Look for this line:
<title><?php echo TITLE; ?> - <?php echo $products_name; ?></title>
And change it to:
<title><?php echo TITLE; ?> - <?php echo $products_name; ?></title>
IGNORE THE MODS BELOW.
This is a FULL version with ADDED meta tag queries, etc for better search engine optimization.
DOWNLOAD THIS ONE INSTEAD as I missed out a ; in the other one which caused it not to work.
SHOW PRODUCT NAME IN PAGE TITLE
Here's a simple mod to make the product name show up in the page title.
Ideal for giving your products better search engine optimization.
Super-easy modification. 30 seconds at most. One line of code.
Note: Contributions are used at own risk.