Forums / Templates, Stylesheets, Page Layout / Remove Product Title from Breadcrumb

Remove Product Title from Breadcrumb

Locked

Views: 4,061

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
3 Sep 2007, 9:16 PM
#2
gems14k avatar

gems14k

New Zenner

Join Date:
Jul 2005
Posts:
95
Plugin Contributions:
0

Re: Remove Product Title from Breadcrumb

Or how can I replace the product name with product model number in the breadcrumb?

3 Sep 2007, 9:24 PM
#3
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Remove Product Title from Breadcrumb

/includes/init_includes/overrides/init_add_crumbs.php
(make a copy from init_includes if you don't have one in "overrides" already)
around line 54 you have this section:```
/**

  • add the products model to the breadcrumb trail
    */
    if (isset($_GET['products_id'])) {
    $productname_query = "select products_name
    from " . TABLE_PRODUCTS_DESCRIPTION . "
    where products_id = '" . (int)$_GET['products_id'] . "'
    and language_id = '" . $_SESSION['languages_id'] . "'";

$productname = $db->Execute($productname_query);

if ($productname->RecordCount() > 0) {
[B]//[/B] $breadcrumb->add($productname->fields['products_name'], zen_href_link(zen_get_info_page($_GET['products_id']), 'cPath=' . $cPath . '&products_id=' . $_GET['products_id']));
}
}
either add the slashes near the end as shown above, or to switch to model number, change 4 sections as shown below:
/**

  • add the products model to the breadcrumb trail
    */
    if (isset($_GET['products_id'])) {
    $productname_query = "select [B]products_model[/B]
    from " . [B]TABLE_PRODUCTS . "[/B]
    where products_id = '" . (int)$_GET['products_id'] [B]. "'";[/B]
    // and language_id = '" . $_SESSION['languages_id'] . "'";

$productname = $db->Execute($productname_query);

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

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

4 Sep 2007, 5:38 AM
#4
gems14k avatar

gems14k

New Zenner

Join Date:
Jul 2005
Posts:
95
Plugin Contributions:
0

Re: Remove Product Title from Breadcrumb

Thank you, DrByte. I'd never figured that out...

16 Dec 2008, 10:09 PM
#5
ellivir avatar

ellivir

Zen Follower

Join Date:
Sep 2005
Posts:
444
Plugin Contributions:
0

Re: Remove Product Title from Breadcrumb

gems14k:

Thank you, DrByte. I'd never figured that out...

Yeah that was helpful... :)

I may be blond but at least I found Zen.

16 Sep 2009, 1:18 AM
#6
creative_mind avatar

creative_mind

New Zenner

Join Date:
Mar 2009
Location:
Colorado Springs, Colorado
Posts:
25
Plugin Contributions:
0

Re: Remove Product Title from Breadcrumb

I am using the latest version of Zen-Cart.

I have my breadcrumb setup as:

Home - Category Name

How do I add the product count at the end to show:

Home - Category Name (45 products)

Thanks.