Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Breadcrums - display Product instead of Model


Guest

Recommended Posts

:blink:

 

I wanted to display the name of the product instead of it's model at the end of my breadcrumbs.. to do this I modified the application_top.php file by replacing:

 

// 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'])) {
$name_query = tep_db_query("select products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
if (tep_db_num_rows($name_query)) {
  $name = tep_db_fetch_array($name_query);
  $breadcrumb->add($name['products_name'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
}
 }

 

:D

Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...
  • 2 weeks later...

Awesome, I like. I really need to backup before I loose all this nice stuff I've added...

 

Thomas

A signature is something that reflects its user. - The dictionary

 

The question is not, 'to code, or not to code'

the question is, 'if we do not code, are we really alive?'

-- anonymous

Link to comment
Share on other sites

  • 1 month later...

Anyone know how to enable this for multi-language support.

 

It works like a dream in english but only displays the "english" product name when viewed in german, where a "german" product name exists ?

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...