Jump to content

Archived

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

Snowman

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

Recommended Posts

For osCommerce-2.2rc2 - Here is the code to change Let's See What We Have Here to the Category Name. This works for sub-categories as well (at least in my test) This code was borrowed from an earlier post being used for a much earlier version of osCommerce and I have tested in two different osCommerce -2.2rc2 stores and it works. The directions for inserting the code weren't exactly clear, so I am posting this for clarification.

 

Hack: Add Category Name over Product Listings instead of Let’s See What We Have Here

 

Open catalog/index.php and find:

 

require('includes/application_top.php');

 

After it, insert:

 

//category name hack starts

 

function tep_get_category_name($category_id) {

 

global $languages_id;

 

$category_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . $category_id . "' and language_id = '" . $languages_id . "'");

 

$category = tep_db_fetch_array($category_query);

 

return $category['categories_name'];

 

}

 

//category name hack stops

 

Then find all references to:

 

<?php echo HEADING_TITLE; ?>

 

and change to:

 

<?php echo tep_get_category_name($current_category_id); ?>

 

Then open categories/includes/languages/english/index.php, find:

 

define('HEADING_TITLE', 'Let\’s See What We Have Here');

 

And change to:

 

define('HEADING_TITLE', $current_category_id);

 

Then find:

 

elseif ($category_depth == 'nested') {

define('HEADING_TITLE', 'Categories');

 

And change to:

 

elseif ($category_depth == 'nested') {

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

Post these files to the server in their corresponding locations. Check your catalog to view the Category Headings over the Product Listing. Remember, always back up your files before making changes.

 

I've got this to work, however now i've got a blank space instead of the heading on the index page which normally says 'whats new here?' and i've also got the same problem when selecting a manufacturer. Any idea how to fix these issues?


Scott

Share this post


Link to post
Share on other sites
I've got this to work, however now i've got a blank space instead of the heading on the index page which normally says 'whats new here?' and i've also got the same problem when selecting a manufacturer. Any idea how to fix these issues?

 

Ok i've fixed the 'whats new here?' part. To make sure you still get this to show you need to leave <?php echo HEADING_TITLE; ?> in the //default page section above where it says customer greeting (around line 300 of catalog/index.php, mines heavily modified so i cant give you the exact line sorry) instead of changing it to <?php echo tep_get_category_name($current_category_id); ?>

 

 

The manufacturer part i'm still working on


Scott

Share this post


Link to post
Share on other sites

×