Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Including the Product Name in <TITLE></TITLE> tag


SHANX6336

Recommended Posts

Hi,

 

I became frustrated after I tried installing the Header Tags Controller and I am looking for an easy way to include a product's name in the <TITLE></TITLE> tag. By using the following code inside the <TITLE></TITLE> tag, it showed the title of any given page (i.e. About Us, Shipping, Contact Us:

 

<TITLE><?php echo HEADING_TITLE; ?></TITLE>

 

Now I wanted for the product's name to appear in the TITLE for the product_info.php file so that each individual product would have a unique title bar. I used the following code:

 

<TITLE><?php echo $products_name; ?></TITLE>

 

Using the products_name one did not work the same way. I was unsuccessful. Is there a code I can use that will work? Do I have to install the Headers Tag Controller contribution for this? Is there an easy way to do this? I am experienced in installing contributions but for some reason I had difficulty getting this one to work.

 

I appreciate the assistance.

Link to comment
Share on other sites

Hi,

 

I became frustrated after I tried installing the Header Tags Controller and I am looking for an easy way to include a product's name in the <TITLE></TITLE> tag. By using the following code inside the <TITLE></TITLE> tag, it showed the title of any given page (i.e. About Us, Shipping, Contact Us:

 

<TITLE><?php echo HEADING_TITLE; ?></TITLE>

 

Now I wanted for the product's name to appear in the TITLE for the product_info.php file so that each individual product would have a unique title bar. I used the following code:

 

<TITLE><?php echo $products_name; ?></TITLE>

 

Using the products_name one did not work the same way. I was unsuccessful. Is there a code I can use that will work? Do I have to install the Headers Tag Controller contribution for this? Is there an easy way to do this? I am experienced in installing contributions but for some reason I had difficulty getting this one to work.

 

I appreciate the assistance.

 

 

put the following piece of code after the line

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

 

 

$get_pname = 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 . "'");

 

$products= tep_db_fetch_array($get_pname);

 

and then replace the title with the following code

 

<title><?php echo $products['products_name']; ?></title>

 

I think this should work for you :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...