Show category ID on categories page right hand column

Open to all! Ask other shopowners for help.
Post Reply
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Show category ID on categories page right hand column

Post by 14Steve14 »

I am trying somethin in my current old store and I needed to show the category ID on the right hand side of the category page.

I created the language define and found the place to edit and have added the following to categories.php

Code: Select all

$contents[] = ['text' => TEXT_CATEGORIES_ID . ' ' . ($cInfo->categories_id)];
above

Code: Select all

$contents[] = ['text' => TEXT_DATE_ADDED . ' ' . tep_date_short($cInfo->date_added)];
It does work, but I just wanted to check that I had it right. Is that the correct way to find the category_id.


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
burt
Core Team
Posts: 4551
Joined: Tue Oct 29, 2019 9:37 am
Phoenix Version: v1.1.0.8
Has thanked: 252 times
Been thanked: 412 times

Re: Show category ID on categories page right hand column

Post by burt »

Yes, that is the way to do it. To save on a core code change, try it with a hook. UNTESTED:

Make file called cat_id.php and upload to /includes/hooks/admin/catalog/

Code: Select all

class hook_admin_catalog_cat_id {
  function listen_infoBox($parameters) {
    global $cInfo;
    
    $parameters['contents'][] = ['text' => TEXT_CATEGORIES_ID . ' ' . ($cInfo->categories_id)];
  }
}
If on an older Phoenix, catalog may need to be categories (in both places in the above code).
I am not here to build for you.
I am here to build with you. Let's help each other.
14Steve14
Senior Contributor
Posts: 923
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Show category ID on categories page right hand column

Post by 14Steve14 »

Cheers Gary. Hopefully its only a temporary thing.


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply