{php}
$smarty_product_id = $this->get_template_vars( 'product' );
$product_id = $smarty_product_id['product_id'];
$select_1 = mysql_query( "SELECT * FROM cscart_products_categories WHERE product_id=$product_id");
while ($row_1 = mysql_fetch_array($select_1)) {
$category_id = $row_1["category_id"];
$select_2 = mysql_query( "SELECT * FROM cscart_categories WHERE category_id=$category_id");
while ($row_2 = mysql_fetch_array($select_2)) {
$id_path = $row_2["id_path"];
$id_path_boom = explode("/", $id_path);
foreach($id_path_boom as $category_id_2){
$select_3 = mysql_query( "SELECT * FROM cscart_category_descriptions WHERE category_id=$category_id_2");
while ($row_3 = mysql_fetch_array($select_3)) {
echo $row_3["category"];
}
echo " ";
}
echo "<br>";
}
}
{/php}
If you copy the above to "product_details.tpl" it will display all categories associated with your product. The coding is somewhat crude but its all I knew how to do as this Smarty stuff is new ground for me. You may have to modify the queries depending on your installation. I'm not sure if all the queries will slow anything down, so YMMV.
If anyone wants to clean it up and maybe Smarty-ize it, be my guest. I'm strill trying to figure out how to get just the first three levels to display instead of all of them.