Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

A little code help please


Recommended Posts

Hi I use this code to display the current categorie in certian situations.


<?php echo ucwords(strtolower($categories['categories_name'])); ?>


I would also like to display the parrent categorie if there is one.


so if you ar selling a mazda it says




when you go to subcategorie it says the sub catagorie i would like it to also tell me the perrent categorie of the sub categorie.


I have been trying for like a month can any one help



Link to comment
Share on other sites

You would want something like

$parent_category_query = tep_db_query("select categories_name from " . TABLE_CATEGORIES_DESCRIPTION . " where categories_id = '" . (int)$categories['parent_id'] . "'");
$parent_category = tep_db_fetch_array($parent_category_query);
echo ucwords(strtolower($categories['categories_name']));

You may need to add parent_id to the query that populates the $categories array.




Always back up before making changes.

Link to comment
Share on other sites


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

  • Create New...