Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Missing product breadcrumb


arse_soul

Recommended Posts

Hiya...i would like to know where the breadcrumbs for the products are created to be displayed on the product_info.php page. I may have deleted something which has led to the name of the product not being shown... i get somthing like this:-

 

Top ? Catalog ? Category ?

 

as you can see the name of the product is not there... it should look something like this:-

 

Top ? Catalog ? Category ? Product

 

when viewing the source code the hyperlink is created but is not linked to the product name, i.e:-

 

<a href="http://localhost/catalog/product_info.php?cPath=21&products_id=36" class="headerNavigation"></a>

 

instead of somthing like this:-

 

<a href="http://localhost/catalog/product_info.php?cPath=21&products_id=36" class="headerNavigation">PRODUCT</a>

 

any help would be much appreciated!!!

 

Sul.

Link to comment
Share on other sites

The breadcrumb shows model number, not product name. If you want it to show product name, you would need to modify a statement that says $breadcrumb->add(...) appropriately.

 

Hth,

Matt

Link to comment
Share on other sites

application_top.php - change:

 

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

   }

 }

 

to:

 

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

   }

 }

Link to comment
Share on other sites

Would it be possible to display both product name and product model in the same breadcrumb link?

 

ie catalog >> products >> subcategory >> bicycle : R-800

 

Note: I want the model (R-800) to merge with the product name (bicycle) if the model name excists.

 

I managed to get both showing if I incuded both functions for model and name. but then when I didn't have a model my breadcrumb would end with ">>" which I didn't like...

 

I tried stacking the queries in one function and then simply add the products name but it didn't work:

 

add($model['products_model']$product_bc['products_name'] , tep_href_link(FILENAME_PRODUCT_INFO,

 

 

Could I change the add function in the breadcrumb.php file to include a second title if available?

 

Like:

    function add($title, $model, $link = '') {

     $this->_trail[] = array('title' => $title, 'model' => $model, 'link' => $link);

   }

 

or how would I do it, if at all possible?

Link to comment
Share on other sites

Thanks a lot Matt!

That did the trick!! :) Now this is what I did for whoever is interested in the same thing. Doing the following will display the product name with a space followed by product model (if exist).

 

// add the products name and model to the breadcrumb trail

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

   $product_bc_query = tep_db_query("select p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and pd.language_id = '" . $languages_id . "'"); 

$product_bc = tep_db_fetch_array($product_bc_query); 

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

   $model = tep_db_fetch_array($model_query);

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

 }

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...