Just thought I'd share some of the code I came up with for shoppingcart.php changing function get_products() a bit. Seems to be working fine like this. Basically I did some table joins like this.
$products_query = tep_db_query("select
cr.parent_id,
c.categories_id,
p.products_id,
pd.products_name,
p.products_model,
p.products_image,
p.products_price,
p.products_weight,
p.products_tax_class_id from
" . TABLE_PRODUCTS . " p,
" . TABLE_CATEGORIES . " cr,
" . TABLE_PRODUCTS_TO_CATEGORIES . " c,
" . TABLE_PRODUCTS_DESCRIPTION . " pd where
p.products_id = '" . (int)$products_id . "' and
c.products_id = p.products_id and
cr.categories_id = c.categories_id and
pd.products_id = p.products_id and
pd.language_id = '" . (int)$languages_id . "'");
and
$thesubcat_name = $this->getcatnamenow($products['categories_id']);
$parentcat_name = $this->getcatnamenow($products['parent_id']);
and
function getcatnamenow($somecatid){
$catname_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$somecatid . "'");
if (tep_db_num_rows($catname_query)) {
$thecatname = tep_db_fetch_array($catname_query);
return $thecatname['categories_name'];
}else{
return '';
}
}