Platinum Games Posted October 19, 2008 Posted October 19, 2008 just a quick question, how can i change the product name in the breadcrumb??? it currently shows the product ID code...can this be changed to show the product name??? Thanks in advance! Ben
Guest Posted October 19, 2008 Posted October 19, 2008 Catalog > Includes > application_top.php Find this near the bottom of the file: // 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'])); } } Replace it with this: // add the products name to the breadcrumb trail if (isset($HTTP_GET_VARS['products_id'])) { //notice the below query from TABLE_PRODUCTS_DESCRIPTION instead of TABLE_PRODUCTS that does not have field 'products_name'. $crumb_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($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'])); } } So...rather than outputting the model number of the product, the breadcrumb displays the product name instead.
Platinum Games Posted October 19, 2008 Author Posted October 19, 2008 Catalog > Includes > application_top.php Find this near the bottom of the file: // 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'])); } } Replace it with this: // add the products name to the breadcrumb trail if (isset($HTTP_GET_VARS['products_id'])) { //notice the below query from TABLE_PRODUCTS_DESCRIPTION instead of TABLE_PRODUCTS that does not have field 'products_name'. $crumb_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($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'])); } } So...rather than outputting the model number of the product, the breadcrumb displays the product name instead. Works perfect, thank you very much... Thanks in advance! Ben
Recommended Posts
Archived
This topic is now archived and is closed to further replies.