Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help: Category Name instead of "Lets see what we have h


Snowman

Recommended Posts

This is for MS1

 

You should just need to change the one line per the 3 sections, exact line numbers may vary, but you are replace the HEADING_TITLE with the new code in each case.

 

The new functions can go either in general.php or you can add a new funciton file and add an include line to the general.php so that you keep new functions seperate from existing functions.

 

Example: create a file called /includes/functions/my_functions.php and add to the general.php file at the bottom, before the ?>

require(DIR_WS_FUNCTIONS . my_functions.php');

 

The Parse error sounds like you missed the closing bracket on one of the new functions.

 

Note: when you edit the general.php make sure there are no trailing blank spaces or lines after the end of the file's ?>

Link to comment
Share on other sites

  • 7 months later...
  • Replies 101
  • Created
  • Last Reply
  • 2 weeks later...

I'm so lost...

 

Instead of seeing "Let's see what we have here" with the products listed below it when I click on a category.. I want to see the Category name.. then the products

 

"Lets see what we have here" is defined in

 

catalogs/includes/languages/english/index.php

 

(i don't see a default.php in that directory OR in the "catalog/" directory)

 

i want to have the Category name.. I don't need manufactures.. just the category name instead of "let's see what we have here"

 

exactly HOW do i affect that change... and where?

Link to comment
Share on other sites

Change the define to

 

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

 

 

then a little below that change

 

the nested define from

 

} elseif ($category_depth == 'nested') {

define('HEADING_TITLE', 'Categories');

 

to

 

} elseif ($category_depth == 'nested') {

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

 

HTH

Tom

Link to comment
Share on other sites

hey thanks to all I needed to do the same and modded this slightly I still wanted it to say Let's see what we have in the so I added the following:

 

<?php echo 'Let\'s see what we have in the ' . tep_get_category_name($current_category_id); ?>

 

it makes it that much nicer :D

Link to comment
Share on other sites

I added the following lines to mine to further edit this, I liked the idea of it displaying the category name but I wanted it to say let's see what we have in the (whatever the category name was) category.

 

Hope this helps someone else along the way

 

<?php echo 'Let\'s see what we have in the ' . tep_get_category_name($current_category_id) . (' category'); ?></td>

:D

 

Happy new years

Link to comment
Share on other sites

  • 1 month later...

Just as an add on in OSC2.2MS2 the 'Let's see what we have here' for manufactures can be easily be changed using the code below. This includes the category name change as well

 

in

catalog/includes/languages/english/index.php

 

change the code from

if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {
 define('HEADING_TITLE', 'Let\'s See What We Have Here');
 define('TABLE_HEADING_IMAGE', '');
 ...
 ...
} elseif ($category_depth == 'nested') {
 define('HEADING_TITLE', 'Categories');
}

 

to

 

if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {
 if (isset($HTTP_GET_VARS['manufacturers_id'])) {
   define('HEADING_TITLE', $manufacturers['manufacturers_name']. ' Products');
 }
 else{
   define('HEADING_TITLE', $categories['categories_name']);
 }
 define('TABLE_HEADING_IMAGE', '');
 ...
 ...
} elseif ($category_depth == 'nested') {
 define('HEADING_TITLE', $categories['categories_name']);
}

 

Rob

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 1 month later...
  • 1 month later...
  • 2 months later...
  • 4 weeks later...
Change the define to

 

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

then a little below that change

 

the nested define from

 

} elseif ($category_depth == 'nested') {

  define('HEADING_TITLE', 'Categories');

 

to

 

} elseif ($category_depth == 'nested') {

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

 

HTH

Tom

This worked perfectly. I had tried to use the hack in the contributions, but that never worked for me.
Link to comment
Share on other sites

Thanks, I spent so much time trying to find out how to change this. I don't understand why ocCommerce does not have the category name in the heading_title in the first place. It took me a little while to find the file to change but that is because I am new at this. includes/languages/english/index.php is where the file is located that needs to be changed.

Link to comment
Share on other sites

  • 2 weeks later...

Thanks a lot it makes a big difference to my site.

 

by the way is there a way to get subcategories to show as (for instance) books - children?

 

many thanks to all of you, you make putting up a site a breeze.

Yehuda

 

 

Like it says: One who is embarrassed will never learn!

Link to comment
Share on other sites

  • 6 months later...

GREAT WORKS 100% ;-) so simple yet so effective!

 

Change the define to

 

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

then a little below that change

 

the nested define from

 

} elseif ($category_depth == 'nested') {

  define('HEADING_TITLE', 'Categories');

 

to

 

} elseif ($category_depth == 'nested') {

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

 

HTH

Tom

Link to comment
Share on other sites

I am doing an oscommerce install - wanted to get rid of the "See What We Have" line.

 

The exeisting fix is great but I wanted to display

Category - Subcategory (Books - Childrens)

 

This works but is not very elegant.

 

In the includes/languages/english/index.php file

 

1 - ADD THESE LINES AFTER

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');

 

// ****************************************************************************

// ***** Use the cPath variable to find category id

$main_cat_id = explode("_",$cPath);

$main_cat_id = $main_cat_id[0];

// ***** Query the db

$sql = tep_db_query("SELECT categories_name FROM categories_description WHERE categories_id='" . $main_cat_id ."'");

$row = tep_db_fetch_array($sql);

$main_cat_display = $row["categories_name"];

// ***** Avoid displaying "Books Books"

if ($categories['categories_name'] <> $main_cat_display){

$heading_title_display = $main_cat_display . " " . $categories['categories_name'];

}else {

$heading_title_display = $categories['categories_name'];

}

// ****************************************************************************

 

2 - REPLACE THE 'products' HEADING TITLE LINE WITH THIS:

define('HEADING_TITLE', $heading_title_display);

 

3 - REPLACE THE 'nested' HEADING TITLE LINE WITH THIS:

define('HEADING_TITLE', $heading_title_display);

Link to comment
Share on other sites

This worked for me (combining a lot of the previous posts)

 

The big change is the customer wanted to say "Now Available in..." before the main category and sub cateogory names.

 

(I'm a php newbie, so backup before you try!)

 

catalog/includes/languages/english/index.php

 

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
// ****************************************************************************
// *****	Use the cPath variable to find category id
$main_cat_id = explode("_",$cPath);
$main_cat_id = $main_cat_id[0];
// *****	Query the db
$sql = tep_db_query("SELECT categories_name FROM categories_description WHERE categories_id='" . $main_cat_id ."'");
$row = tep_db_fetch_array($sql);
$main_cat_display = $row["categories_name"];
// *****	Avoid displaying "Books Books"
if ($categories['categories_name'] <> $main_cat_display){
$heading_title_display = 'Now Available in' . " " . $main_cat_display . " " . $categories['categories_name'];
}else {
$heading_title_display = 'Now Available in' . " " . $categories['categories_name'];	
}
// ****************************************************************************

if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {
 define('HEADING_TITLE', $heading_title_display);
 define('TABLE_HEADING_IMAGE', '');

 

and then at the bottom.

 

} elseif ($category_depth == 'top') {
 define('HEADING_TITLE', $heading_title_display);
} elseif ($category_depth == 'nested') {
 define('HEADING_TITLE', $heading_title_display);
}

Link to comment
Share on other sites

I ended up changing the bottom snippet so the index page would say "Welcome". I didn't realise that this particular 'HEADING_TITLE' controlled that.

 

catalog/includes/languages/english/index.php

 

define('TABLE_HEADING_DATE_EXPECTED', 'Date Expected');
// ****************************************************************************
// *****	Use the cPath variable to find category id
$main_cat_id = explode("_",$cPath);
$main_cat_id = $main_cat_id[0];
// *****	Query the db
$sql = tep_db_query("SELECT categories_name FROM categories_description WHERE categories_id='" . $main_cat_id ."'");
$row = tep_db_fetch_array($sql);
$main_cat_display = $row["categories_name"];
// *****	Avoid displaying "Books Books"
if ($categories['categories_name'] <> $main_cat_display){
$heading_title_display = 'Now Available in' . " " . $main_cat_display . " " . $categories['categories_name'];
}else {
$heading_title_display = 'Now Available in' . " " . $categories['categories_name'];	
}
// ****************************************************************************

if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id'])) ) {
?define('HEADING_TITLE', $heading_title_display);
?define('TABLE_HEADING_IMAGE', '');

 

and then at the bottom.

 

} elseif ($category_depth == 'top') {
 define('HEADING_TITLE', 'Welcome');
} elseif ($category_depth == 'nested') {
 define('HEADING_TITLE', $heading_title_display);
}

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...