Help Modifying Code
Posted: Fri Jun 13, 2008 6:13 pm
Hello,
The below code gives me this output on the site,
AB-1000 Universal Brake Pads ***(which is the product name from the database)
GMC, Hummer ***(categories in which this particular parts is located in database)
Would like it to read like this, I keep trying to modify but keep breaking the site,
AB-1000 Universal Brake Pads ***(which is the product name from the database)
Fits Models: GMC, Hummer ***(categories in which this particular parts is located in database)
Thank you JR
The below code gives me this output on the site,
AB-1000 Universal Brake Pads ***(which is the product name from the database)
GMC, Hummer ***(categories in which this particular parts is located in database)
Would like it to read like this, I keep trying to modify but keep breaking the site,
AB-1000 Universal Brake Pads ***(which is the product name from the database)
Fits Models: GMC, Hummer ***(categories in which this particular parts is located in database)
Thank you JR
Code: Select all
$lc_align = '';
if(isset($HTTP_GET_VARS['language']))
{
$env_language = $HTTP_GET_VARS['language'];
$language_query = tep_db_query("select languages_id from ". TABLE_LANGUAGES . " where code ='" . $env_language . "'");
$language_arr = tep_db_fetch_array($language_query);
$language_id = $language_arr['languages_id'];
}
else
{
$language_id = (int)$languages_id;
}
$products_to_catagories_query = tep_db_query("SELECT categories_name FROM ". TABLE_PRODUCTS_TO_CATEGORIES ." p2c, ". TABLE_CATEGORIES_DESCRIPTION ." cd WHERE p2c.products_id = " . (int)$listing[$x]['products_id'] . " and p2c.categories_id = cd.categories_id and language_id ='".(int)$language_id."'");
$category_list = " ";
do
{
if($category_list != " ")
$category_list .=" , ";
else
$products_to_categories_array = tep_db_fetch_array($products_to_catagories_query);
$category_list .= $products_to_categories_array['categories_name'].'';
}
while($products_to_categories_array = tep_db_fetch_array($products_to_catagories_query));
$category_list .="";
if (isset($HTTP_GET_VARS['manufacturers_id'])) {
$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>'.'<br>
'.$category_list;
} else {
$lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing[$x]['products_id']) . '">' . $listing[$x]['products_name'] . '</a>'.'<br>
'.$category_list;
}
break;