Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to change the page headings


Insiyah

Recommended Posts

You’ll only need to modify index.php. First do a text search for HEADING_TITLE in this file. There should be five occurrences. We’ll change two of those occurrences that look like this:

 

<?php echo HEADING_TITLE; ?>

into this:

 

<?php echo $myCategory['categories_name']; ?>

Don’t touch the one around line 290 - this one prints out the one on the main index page.

 

The other two will look like this (between commas):

 

HEADING_TITLE

change those two:

 

$myCategory['categories_name']

And finally you’ll need to add these two lines to your code right after line 57:

 

<?php

if ($category_depth == 'nested') {

Now should look like this:

 

<?php

$myCategory_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

$myCategory = tep_db_fetch_array($myCategory_query);

if ($category_depth == 'nested') {

And now we can enjoy our category name when visiting categories like this:

 

 

 

I found this on the oscommerce how to website.

 

Amazingly simple.

Link to comment
Share on other sites

This has been mentioned several times in the forums over the years. You can also install one of the HTC contributions that does this as well.

 

See the following link:

http://www.oscommerce.com/forums/index.php?sho...p;#entry1178295

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

The best wy to do this is not totouch the index.php file.

All changes are to be made in the /includes/languages/english/index.php (repeat for any other languages you use).

 

The first one (in that file):

$category_name = (isset($HTTP_GET_VARS['manufacturers_id'])) ? $manufacturers['manufacturers_name'] : $categories['categories_name'];

define('HEADING_TITLE', $category_name);

 

The second one:

define('HEADING_TITLE', $categories['categories_name']);

 

Doing it this way means you keep the index.php file clean and you do not need an extra (useless!) database call.

Link to comment
Share on other sites

The best wy to do this is not totouch the index.php file.

All changes are to be made in the /includes/languages/english/index.php (repeat for any other languages you use).

 

The first one (in that file):

$category_name = (isset($HTTP_GET_VARS['manufacturers_id'])) ? $manufacturers['manufacturers_name'] : $categories['categories_name'];

define('HEADING_TITLE', $category_name);

 

The second one:

define('HEADING_TITLE', $categories['categories_name']);

 

Doing it this way means you keep the index.php file clean and you do not need an extra (useless!) database call.

 

 

Well, thanks for the reply. I get the impression I insulted you with my useless info. Sorry, about that! I'm very new, editing an os commerce site and trying to figure out php. I thought it was an easy solution as I did try another contribution that was too confusing to me. So, please disregard my info everyone. BTW I didn't figure this out it was on http://www.oscommercehowto.com/.

Link to comment
Share on other sites

Well, thanks for the reply. I get the impression I insulted you with my useless info. Sorry, about that! I'm very new, editing an os commerce site and trying to figure out php. I thought it was an easy solution as I did try another contribution that was too confusing to me. So, please disregard my info everyone. BTW I didn't figure this out it was on http://www.oscommercehowto.com/.

 

I wouldn't label your post as "useless info". It is evident that there are several methods to accomplish the same end and anyone of the solutions above might be the "best" solution depending upon one's shop and the various other contributions installed.

 

Thanks for taking the time to post. :)

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

You got the wrong impression totally.

 

I like to use the way that causes the least amount of changes to core files, and uses as little as possible overhead.

 

Every other way (that I have seen), does not appear to work correctly in all circumstances - including yours and the post to which Bill linked.

Link to comment
Share on other sites

You got the wrong impression totally.

 

I like to use the way that causes the least amount of changes to core files, and uses as little as possible overhead.

 

Every other way (that I have seen), does not appear to work correctly in all circumstances - including yours and the post to which Bill linked.

Hi Burt,

 

I like your method as it appears to be the easiest of all of the options. I seen your method a while back on your web site but haven't tried it yet (didn't really need to try it as the logic makes perfect sense to me).

 

FYI: I have never had any situations where the page heading didn't work using my method above. Could you post back or send me an email regarding the special circumstances.

 

Thanks bud,

Bill Kellum

 

Sounds Good Productions

STS Tutorials & more: STSv4.6, STS Add-ons (STS Power Pack), STS V4 Forum STS Forum FREE TEMPLATE

Link to comment
Share on other sites

I wouldn't label your post as "useless info". It is evident that there are several methods to accomplish the same end and anyone of the solutions above might be the "best" solution depending upon one's shop and the various other contributions installed.

 

Thanks for taking the time to post. :)

 

 

Thanks

Link to comment
Share on other sites

Hi! I'm not sure if this is where I post this question, so sorry if in wrong place. I've been looking all over the forums and will try here.

 

I want to change the name of "manufacturer" to something else, which better suits my product. Could someone please tell me where I can change this? Muchas gracias, in advance! Michele

Link to comment
Share on other sites

  • 2 years later...

You’ll only need to modify index.php. First do a text search for HEADING_TITLE in this file. There should be five occurrences. We’ll change two of those occurrences that look like this:

 

<?php echo HEADING_TITLE; ?>

into this:

 

<?php echo $myCategory['categories_name']; ?>

Don’t touch the one around line 290 - this one prints out the one on the main index page.

 

The other two will look like this (between commas):

 

HEADING_TITLE

change those two:

 

$myCategory['categories_name']

And finally you’ll need to add these two lines to your code right after line 57:

 

<?php

if ($category_depth == 'nested') {

Now should look like this:

 

<?php

$myCategory_query = tep_db_query("select cd.categories_name, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");

$myCategory = tep_db_fetch_array($myCategory_query);

if ($category_depth == 'nested') {

And now we can enjoy our category name when visiting categories like this:

 

 

 

I found this on the oscommerce how to website.

 

Amazingly simple.

Link to comment
Share on other sites

PLEASE - If your going to ask us to FIND text or a string - Please make sure it does exsist first. Your instructions are usless to a file that does not have the text you ask us to find. There are no HEADER_TITLE in my index.php

 

All I want to do is remove the sub catagories that are above the What's New section.

 

Haveing catagories and subs show up in 2 places on the same page is really annoying - Very supprized that this is even in the mix with all the "smart" developers on this. If you look at this from a buyers view thn you would not even have put this in from the begining.

 

Do you or any of you have a REAL fix for this?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...