Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Replace product number with product name in breadcrumb?


chadoz

Recommended Posts

Posted

Change this code in catalog/includes/application_top.php so that it gets the product description from the database and displays that instead:

 

// 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']));
   }
 }

Note that the product description query will need to take into account the current language.

 

.

Check out Chad's News.

Posted

Change this code in catalog/includes/application_top.php so that it gets the product description from the database and displays that instead:

 

// 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']));
   }
 }

Note that the product description query will need to take into account the current language.

 

.

 

Thanks so much for the help. Though I understand the idea you explain, I'm not seasoned enough to know what the syntax/id changes that need to be made. My version of the code I think is identical to what you posted. Would it be too much trouble to place the appropriate items in the appropriate places for me? If its easy for you? I would like the product name in place of the product number at the last breadcrumb

Here's what I got...

 

// 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']));
   }
 }

Posted

Hi Chad

 

This change is well documented on the forum, just can't post a link for you. There is also a contribution to do exactly just this change. Try searching there...

Archived

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

×
×
  • Create New...