Contributions
Add Product Title in path (breadcrumb trail)
Just a Simple way of removing the "Model ID" from your Breadcrumb Trail and replace with "Product Name".
For me I don't see the need of having "Model ID" what i want to see is "Product Name" and this is good for SEO as well.
------------------------------------------------------
To install:
*******************************
1. Backup! your copy of /your_catalog_path/includes/application_top.php
*******************************
2. Find in "application_top.php" this line (Around line 486)
// 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']));
}
}
*******************************
3. Replace with:
// add the products name to the breadcrumb trail
if (isset($HTTP_GET_VARS['products_id'])) {
$model_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($model_query)) {
$model = tep_db_fetch_array($model_query);
$breadcrumb->add($model['products_name'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
}
}
------------------------------------------------------
Thats it, Now the "» Model ID" should not appear in your breadcrumb trail.
- Azim (azim.ansari@gmail.com)
| azzu5 | 8 Oct 2007 |
Just a Simple way of removing the "Model ID" from your Breadcrumb Trail and replace with "Product Name".
For me I don't see the need of having "Model ID" what i want to see is "Product Name" and this is good for SEO as well.
------------------------------------------------------
To install:
*******************************
1. Backup! your copy of /your_catalog_path/includes/application_top.php
*******************************
2. Find in "application_top.php" this line (Around line 486)
// 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']));
}
}
*******************************
3. Replace with:
// add the products name to the breadcrumb trail
if (isset($HTTP_GET_VARS['products_id'])) {
$model_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($model_query)) {
$model = tep_db_fetch_array($model_query);
$breadcrumb->add($model['products_name'], tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . $cPath . '&products_id=' . $HTTP_GET_VARS['products_id']));
}
}
------------------------------------------------------
Thats it, Now the "» Model ID" should not appear in your breadcrumb trail.
- Azim (azim.ansari@gmail.com)
Note: Contributions are used at own risk.
