Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Change breadcrumbs to show product name?


charmdiva

Recommended Posts

Posted

Currently, breadcrumbs shows as Home>Category Name>Product Model Number. How would I change this to show the Product Name instead of the Product Model Number? I looked at the breadcrumbs class and it appears to be calling an array. Where is this array created? Thanks.

Posted
Currently, breadcrumbs shows as Home>Category Name>Product Model Number. How would I change this to show the Product Name instead of the Product Model Number? I looked at the breadcrumbs class and it appears to be calling an array. Where is this array created? Thanks.

 

In your includes/application_top.php you need to replace

 

// add the products model to the breadcrumb trail

if (isset($HTTP_GET_VARS['products_id'])) {

$model_query = tep_db_query("select products_model from " . TABLE_PRODUCTS . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");

if (tep_db_num_rows($model_query)) {

$model = tep_db_fetch_array($model_query);

$breadcrumb->add($model['products_model'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));

}

}

 

With

 

// add the products name to the breadcrumb trail

if (isset($HTTP_GET_VARS['products_id'])) {

$crumb_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . $languages_id . "'");

if (tep_db_num_rows($crumb_query)) {

$crumb = tep_db_fetch_array($crumb_query);

$breadcrumb->add($crumb['products_name'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));

}

}

The Knowledge Base is a wonderful thing.

Do you have a problem? Have you checked out Common Problems?

There are many very useful osC Contributions

Are you having trouble with a installed contribution? Have you checked out the support thread found Here

BACKUP BACKUP BACKUP!!! You did backup, right??

  • 1 month later...
Posted

I needed this too and had earlier replaced the original with a version that did not follow the "language trail".

 

Yours does, all languages now specify with product name ...

 

Thanks ozcsys!

Archived

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

×
×
  • Create New...