Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product Name as Title Tag


Guest

Recommended Posts

I need to know if there is a contribution or an easy way for this to happen:

 

When you click on a product, the title of the product is in the "header" section of the site where the "<title>" would normally be.

Link to comment
Share on other sites

I need to know if there is a contribution or an easy way for this to happen:

 

When you click on a product, the title of the product is in the "header" section of the site where the "<title>" would normally be.

 

You have two options Header tag controller (assign what ever you want manually to the <tilte> tag or Dynamic tags which does this automatically.

Backup before making changes. Backup before making changes! Backup before making changes!!

 

You did do a backup? eh?

Link to comment
Share on other sites

I think there is one but i can't find it again... i made my own anyway, very simple!

 

Adding the quesry code:

Add:

  $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'];

above

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

Adding the result product name:

Then add

<?php echo $products_name; ?>

between

<title></title>

..should work

The Coral Room ...store coming soon!

56 contibs added

28 custom creations + additions

6 future contribs

10+ tasks to complete

Link to comment
Share on other sites

Rick, that would perfectly!!! Thank you. Also, thank you for your response ddp.

 

I think there is one but i can't find it again... i made my own anyway, very simple!

 

Adding the quesry code:

Add:

  $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'];

above

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

Adding the result product name:

Then add

<?php echo $products_name; ?>

between

<title></title>

..should work

Link to comment
Share on other sites

  • 2 months later...

Just wanted to ask you which files are you changing with this code? I would like to also dynamically change the header. thanks

 

 

 

 

I think there is one but i can't find it again... i made my own anyway, very simple!

 

Adding the quesry code:

Add:

  $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'];

above

?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

Adding the result product name:

Then add

<?php echo $products_name; ?>

between

<title></title>

..should work

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...