Category Path

function fn_hw_get_path_category($category_id, $id_path='', $lang_code = CART_LANGUAGE) { if(!empty($category_id)) { if(empty($id_path)){ $id_path = db_get_field("SELECT id_path FROM ?:categories WHERE category_id=".$category_id); } $path = preg_split("/\//",$id_path); $category_desc = ''; foreach ($path as $path_key => $path_value) { if(!empty($path_value)) { $temps = db_get_field('SELECT category FROM ?:category_descriptions WHERE category_id=?s AND lang_code=?s', $path_value, $lang_code); $category_desc .= $temps." / "; } // end if } // end foreach $category_desc = preg_replace("/ \/ $/","",$category_desc); return $category_desc; } // end if

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.