Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to get Sub-Category ID ?


allright

Recommended Posts

<?php
$sub_categories_query = tep_db_query("select categories_id from " . TABLE_CATEGORIES . "  where parent_id = '" . (int)$current_category_id."'");
while ($sub_categories = tep_db_fetch_array($sub_categories_query)) {
echo $sub_categories['categories_id']; /// or what you want
}
?>

Open source n'est pas un échange à sens unique ... La plupart du temps un simple merci ou quelques mots d'encouragement suffisent...

Link to comment
Share on other sites

another solution, more elegant:

 

<?php
$arr= tep_get_categories('', (int)$current_category_id);
for ($i=0; $i<sizeof($arr); $i++) {
echo $arr[$i]['id']; /// or what you want
}
?>

Open source n'est pas un échange à sens unique ... La plupart du temps un simple merci ou quelques mots d'encouragement suffisent...

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...