Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Changing Breadcrumb Value for Page Type

Changing Breadcrumb Value for Page Type

Locked

Views: 823

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
30 Apr 2008, 4:31 PM
#1
verd avatar

verd

New Zenner

Join Date:
Apr 2008
Posts:
7
Plugin Contributions:
0

Changing Breadcrumb Value for Page Type

Hey,

I'm looking for a way to change the breadcrumb value for product pages to 'Product'. So, for example, rather than seeing "Zen Cart Store > Hardware Products > Keyboards > Logitech G15 Gaming Keyboard" in the breadcrumb trail, they would see "Zen Cart Store > Hardware Products > Keyboards > Product".

That's about it. Unfortunately, I can't link to my install as it is run locally, but I don't think you need to see my install to see what I'm saying.

Thanks in advance for any help you can offer, and please let me know if you would like clarification on what I'm asking. :smile:

30 Apr 2008, 6:14 PM
#2
verd avatar

verd

New Zenner

Join Date:
Apr 2008
Posts:
7
Plugin Contributions:
0

Re: Changing Breadcrumb Value for Page Type

Ah-ha, worked it out. Here's what I did:

includes/init_includes

Copy init_add_crumb.php to /overrides (if there isn't already one there) and open it

Lines 67-69 (from original):

  if ($productname->RecordCount() > 0) {
    $breadcrumb->add($productname->fields['products_name'], zen_href_link(zen_get_info_page($_GET['products_id']), 'cPath=' . $cPath . '&products_id=' . $_GET['products_id']));
  }

Change that to:

  if ($productname->RecordCount() > 0) {
    $breadcrumb->add("Product");
  }

Edit 'Product' with what you want the last value in a breadcrumb trail on a product page to read. Works perfectly.

30 Apr 2008, 7:31 PM
#3
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: Changing Breadcrumb Value for Page Type

Thanks for posting your solution. It'll help others looking to do the same thing.