Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Is there a way to make the title say the product?


Guest

Recommended Posts

Posted

Is there a way to make the title say the product name? My site title is Ecstasy Glass, and all the titles in all the pages say the exact same thing that the title is set to in the config

 

is there a way to make each page reflect the product name?

 

this is for search engines mainly, so the engine can pick up

 

"Ecstasy Glass - Jamie Sweet's Sword"

 

instead of

 

"Ecstasy Glass - Glass At Low Prices" on every single page....

Posted

Add this to the top of /catalog/product_info.php within the PHP tags:

 

  $page_title_query = tep_db_query("select p.products_id, pd.products_name, p.products_model from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");
 $page_title = tep_db_fetch_array($page_title_query);

 

 

Then change the title line in the HTML to this:

 

<title><?php echo TITLE . ' - ' . $page_title['products_name'] . ' [' . $page_title['products_model'] . '] '; ?></title>

Posted
Add this to the top of /catalog/product_info.php within the PHP tags:

Then change the title line in the HTML to this:

wow, thanks....

 

has anyone ever told you that you rock!

Posted

Thats great stuff, do you have to add the title html bit to every product page you have or just the one main page.

 

What page doe sthe html title code bit go on pleae, the 2nd bit of code you say to paste into the html.

 

thanks i was after this as well.

Posted
Thats great stuff, do you have to add the title html bit to every product page you have or just the one main page.

 

What page doe sthe html title code bit go on pleae, the 2nd bit of code you say to paste into the html.

 

thanks i was after this as well.

Both bits go in product_info.php. There is only 1 product page. ;)

 

However, if you wanted dynamic titles on every page (i.e. page title would reflect the page headeing) you would need to edit every page - but that's a different thread. :)

Posted

But he says change the title line in the html and i cant see which one, ive paste dthe first lot of code into my product page but dont know where to paste the 2nd lot of code.

Posted
But he says change the title line in the html and i cant see which one, ive paste dthe first lot of code into my product page but dont know where to paste the 2nd lot of code.

line #24

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

change this line

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Posted
I dont have that code in my product_info.php page.

do you have this code

define('TEXT_PRODUCT_NOT_FOUND', 'Product not found!');
define('TEXT_CURRENT_REVIEWS', 'Current Reviews:');

if so you are looking at the wrong product_info.php file

 

catalog/product_info.php is the file you want

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Posted

Right i need to downloa dthe page dont i, do i downloa dthe page to my pc, open it up in dreamweaver or wordpad and make the changes, which one please.

 

Then i simply upload the page back yes.

Posted

you can use notepad or dreamweaver I would not use wordpad as it can insert characters to the code.

 

Ftp download using something like ws_ftp open with dreamweaver change code save upload using ftp

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Posted

Can you just use the OSCommerce editor in the Admin panel? Go to TOOLS, then FILES, then select the file you want and click on EDIT then SAVE?

Posted
Can you just use the OSCommerce editor in the Admin panel?  Go to TOOLS, then FILES, then select the file you want and click on EDIT then SAVE?

Not a recommended method as there are known issues with the file manager removing code from files, one such issue is the removal of backslashes from the code which can lead to parse errors.

 

another such issue is inclusion of whitespace.

 

another such issue is corruption of && becoming &

No longer giving free advice. Please place deposit in meter slot provided.  Individual: [=] SME: [==] Corporation: [===]
If deposit does not fit one of the slots provided then you are asking too much! :P

Is your Osc dated try Phoenix  raising oscommerce from the ashes.

Posted

Could you be more specific as to where to put this please.

I know it goes at the top of product_info.php but where, before the <title><? php echo TITLE .......</title>

 

$page_title_query = tep_db_query("select p.products_id, pd.products_name, p.products_model from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "'");

$page_title = tep_db_fetch_array($page_title_query);

  • 3 weeks later...

Archived

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

×
×
  • Create New...