Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Products model to product name in breadcrumb trail


Recommended Posts

Hi

 

I am trying to change the Products model to product name in breadcrumb trail.

I have instaled SEO-Reloaded and found where I need to change

// add the products model to the breadcrumb trail
  if (isset($HTTP_GET_VARS['products_id'])) {
    // header tags seo - reloaded
    $model_query = tep_db_query("select coalesce(NULLIF(pd.products_seo_title, ''), p.products_model) as products_model from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
    // eof
    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']));
    }
  }

This is what I changed to, but it doesn't work, what do I need to change please.

// add the products model to the breadcrumb trail
  if (isset($HTTP_GET_VARS['products_id'])) {
    // header tags seo - reloaded
    $model_query = tep_db_query("select coalesce(NULLIF(pd.products_seo_title, ''), p.products_model) as products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "'");
    // eof
    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']));
    }
  }

Many thanks

Grandpa

Link to comment
Share on other sites

This is how mine looks like


  if (isset($HTTP_GET_VARS['products_id'])) {
// BOF HEADER TAGS SEO - RELOADED
    $model_query = tep_db_query("select coalesce(NULLIF(pd.products_seo_title, ''), pd.products_name) as products_name from " . TABLE_PRODUCTS_DESCRIPTION . " pd where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "'");
// EOF HEADER TAGS SEO - RELOADED
	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']));
    }
  }
Link to comment
Share on other sites

If your model number has meaning for the product, it should be displayed along with the name, not one or the other. But if the model number is just some number used on the site, then it should be replaced. This is an option in Header Tags SEO so you can see the code used in it to see how to add them both for your shop.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...