Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted

HI

I Mde template for categories and it is working....

The thing is that i have the title:"let's see what we have here" appering in all the categories.

Do you know how can i cange it?

thak you for any help

Posted (edited)

Hi Sefimor,

 

I got this out of Bill Kelum's " STS Tips, Tricks and How to's Volume One." is found here. You should really check it out, short read, great info.

 

Dynamic Page Heading Title for STS

 

TO THE STS COMMUNITY: I know this doesn't really apply to STS directly, but I'm posting it anyway since most of the STS users are not familiar with PHP and I feel that fellow STS'ers could benefit from this little hack that works nicely along with the STS template theory.

 

To get rid of "Let's See What We Have Here" for your Categories and Sub-Categories, you can replace them with the name of the categories or subcategories name.

 

Here is how I hacked the OsCommerce code to do it:

Open the following file in a text editor:

/yourstore/index.php

Do a search for the following line of code:

 

<?php echo HEADING_TITLE; ?>

 

You will find three instances of each. Do the following:

To see the name of your CATAGORIES instead of "let's see what we have here" text, just replace the first instance of the code:

 

<?php echo HEADING_TITLE; ?>
With the following:
<?php echo $category['categories_name'] ?>

 

To also have SUBCATEGORIES displayed dynamically as the CATAGORIES above, just replace the second instance of the code:

 

<?php echo HEADING_TITLE; ?>

 

With the following:

 

<?php
$category_query1 = 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 . "'");
$category1 = tep_db_fetch_array($category_query1);
if ($category1['categories_name'] != "") {echo $category1['categories_name'];} else { echo HEADING_TITLE;}
?>

 

The third <?php echo HEADING_TITLE; ?> should be left alone so you do not need to modify it at all.

Don't forget to save your document as the same name as the original index.php. That's all there is to it.

 

Hope this helps,

Dano

Edited by dealindano

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...