Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Pageheader and Subheaders Addon


Naloomi

Recommended Posts

Hello all. My first post here, and let me say that the forum support here is great. It has answered virtually every question I have had to date, except one.

 

I am using the Pageheader and Subheaders addon found here.

 

My store is located here: http://nalsworkshop.com/catalog/

 

If you click on either of my categories, they show the following:

 

Categories

CATEGORY_DESCRIPTION_TITLE

CATEGORY_DESCRIPTION_TEXT

 

yet all of my sub-categories work correctly. Here is the elseif statement used to for the Hirst Arts primary category in my index.php file.

 

elseif ($breadcrumb->last() == 'Hirst Arts') {

$product_title = 'Hirst Arts';

$product_text = 'Build Your Own Castles, Gaming Terrain, or Dioramas';

 

}

 

 

I have the " elseif ($breadcrumb->last() == 'Hirst Arts') " stuff in alphabetical order, hoping it would work, no joy.

 

I have even added

else {

$product_title = $breadcrumb->last();

$product_text = '';

 

}

 

 

at the end, hoping to get it to at least tell me what it is finding, still no luck.

 

Any and all help would be greatly appreciated. Any one have any suggestions?

 

Thank you in advance.

 

Naloomi

Link to comment
Share on other sites

A buddy of mine who does PHP for a living helped me out.

 

In catalog*/includes/languages/english/index.php

 

change

define('HEADING_TITLE', 'Categories');

 

to

define('HEADING_TITLE', $breadcrumb->last());

define('CATEGORY_DESCRIPTION_TITLE', $product_title);

define('CATEGORY_DESCRIPTION_TEXT', $product_text);

 

 

This change fixed my site just fine. I hope it works for others who have the same issue.

 

Naloomi

Link to comment
Share on other sites

Hello

 

I did follow your suggestion but I get a fatal error ...

Fatal error: Call to undefined method breadcrumb::last() in /home/wwwwems/public_html/demoplain/includes/languages/english/index.php on line 39

 

A buddy of mine who does PHP for a living helped me out.

 

In catalog*/includes/languages/english/index.php

 

change

define('HEADING_TITLE', 'Categories');

 

to

define('HEADING_TITLE', $breadcrumb->last());

define('CATEGORY_DESCRIPTION_TITLE', $product_title);

define('CATEGORY_DESCRIPTION_TEXT', $product_text);

 

 

This change fixed my site just fine. I hope it works for others who have the same issue.

 

Naloomi

Link to comment
Share on other sites

  • 5 months later...

Here is the complete install which includes the above post to make it work properly. The original had a top category bug!

 

PageHeaders_and_Subheaders

 

This contribution displays the Parent or Child Category Name in the HEADING_TITLE,

instead of the standard "Let's See What We Have Here" message and it adds a

CATEGORY_DESCRIPTION_TITLE under the HEADING_TITLE to further describe the category.

In addition it adds a text section on the Category Page that you can use to

describe the category with keyword rich text, so this page has content for

the search engines to index.

 

This contribution is from KaiAnimation (Danny).

Further credit goes to PelleonUK for adding the category name to the HEADING_TITLE.

 

 

Files to Modify:

*catalog*/index.php

*catalog*/stylesheet.css

*catalog*/includes/classes/breadcrumb.php

*catalog*/includes/languages/english/index.php

 

Make a backup of these files before you do any editting.

 

 

 

Last Edited 10th December 2005 11:00pm PST

The edits made were to add a CATEGORY_DESCRIPTION_TITLE in the child categories.

 

 

 

------------------------------------------------------------------

 

OPEN: *catalog*/includes/classes/breadcrumb.php

 

FIND:

 

class breadcrumb {

var $_trail;

 

 

function breadcrumb() {

$this->reset();

}

 

 

 

CHANGE TO:

 

class breadcrumb {

var $_trail;

 

function last() {

$trail_size = sizeof($this->_trail);

return $this->_trail[$trail_size-1]['title'] ;

}

 

function breadcrumb() {

$this->reset();

}

 

 

------------------------------------------------------------------

 

OPEN: *catalog*/includes/languages/english/index.php

 

 

 

Find:

define('HEADING_TITLE', 'Categories');

 

Change to:

define('HEADING_TITLE', $breadcrumb->last());

define('CATEGORY_DESCRIPTION_TITLE', $product_title);

define('CATEGORY_DESCRIPTION_TEXT', $product_text);

 

 

 

 

 

 

FIND:

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

 

CHANGE TO:

 

define('HEADING_TITLE', $breadcrumb->last());

define('CATEGORY_DESCRIPTION_TITLE', $product_title);

define('CATEGORY_DESCRIPTION_TEXT', $product_text);

 

 

 

 

FIND:

 

define('HEADING_TITLE', 'What\'s New Here?');

 

CHANGE TO:

 

define('HEADING_TITLE', $breadcrumb->last());

define('CATEGORY_DESCRIPTION_TITLE', $product_title);

define('CATEGORY_DESCRIPTION_TEXT', $product_text);

 

 

 

FIND:

 

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

 

 

ADD just below:

 

// Define Category Descriptions

// Change text to suit.

// If you need to use an apostrophe make certain to use \' as in: Let\'s

 

if ($breadcrumb->last() == 'Hardware') {

$product_title = 'A Section of Computer Hardware';

$product_text = 'Our Computer Hardware is the finest hardware on the internet! It\'s something beyond compare!';

 

} elseif ($breadcrumb->last() == 'Software') {

$product_title = 'A Section of Computer Software';

$product_text = 'Our Computer Software is the finest in the internet!';

 

} elseif ($breadcrumb->last() == 'DVD Movies') {

$product_title = 'A Small Section of DVD Movies';

$product_text = 'This section may be small, but the quality is large.';

 

}

 

 

 

------------------------------------------------------------------------------------------

 

OPEN: *catalog*/index.php

 

SEARCH THE FIRST OCCURANCE: HEADING_TITLE

 

FIND:

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

</tr>

 

 

REPLACE WITH:

 

<tr>

<td class="pageHeading"><?php echo HEADING_TITLE; ?></td>

<td class="pageHeading" align="right"><?php echo tep_image(DIR_WS_IMAGES . $category['categories_image'], $category['categories_name'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

<tr>

<td class="categorySubHeading"><?php echo CATEGORY_DESCRIPTION_TITLE; ?></td>

</tr>

<tr>

<td class="categoryText"><?php echo CATEGORY_DESCRIPTION_TEXT; ?></td>

</tr>

</tr>

 

 

 

SEARCH THE THIRD OCCURANCE: HEADING_TITLE

 

FIND:

<td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>

 

 

 

ADD just below:

 

 

<tr>

<td class="categorySubHeading"><?php echo CATEGORY_DESCRIPTION_TITLE; ?></td>

</tr>

<tr>

<td class="categoryText"><?php echo CATEGORY_DESCRIPTION_TEXT; ?></td>

</tr>

 

 

 

// TIP: If you'd like the CATEGORY_DESCRIPTION_TEXT to be on another part of your Category page then just move these lines.

// <tr>

// <td class="categoryText"><?php echo CATEGORY_DESCRIPTION_TEXT; ?></td>

// </tr>

 

------------------------------------------------------------------------------------------

 

OPEN: *catalog*/stylesheet.css

 

SEARCH: .boxText

 

FIND:

 

.boxText {

FONT-SIZE: 10px; FONT-FAMILY: Verdana, Arial, sans-serif

}

 

// Your .boxText data may be different.

 

 

ADD JUST BELOW:

 

.categorySubHeading {

FONT-WEIGHT: bold; FONT-SIZE: 16px; COLOR: #9a9a9a; FONT-FAMILY: Verdana, Arial, sans-serif

}

.categoryText {

FONT-SIZE: 10px; FONT-FAMILY: Verdana, Arial, sans-serif

}

 

// Customize the style to match your site. These will match a vanilla osC site.

 

--------------------------------------------------------------------------------------------

Save the four files and you will get:

 

-The category heading at the top of each category page instead of the standard "Let's See What We Have Here."

-A category subheading for you to change to suit.

-A category text section for you to change to suit.

 

Charles

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...