How to show child category image

  • Posts: 5
  • Thank you received: 0
13 years 11 months ago #4408

Hi.

I'd like to know if there is a way to show child category image in the category list.
As is, the category list only has the option to show the top category image, but there is no such option for the child categories.
The child categories are in ul list format and seem to only come out as text.

Playing around with listing_div, I hoped that there might be file path information in $child->row->file_path, to no luck.
If there are no other way, I can get the file path info by calling the DB using $child->category_id, but I was hoping that the information might already exist.
I'd appreciate it if you can clear that up.

Thanks!

Please Log in or Create an account to join the conversation.

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
13 years 11 months ago #4409

Hi,

That's indeed the case. The image information isn't loaded for child categories in the categories listing. So you will have to write a small SQL query to retrieve it and then use the data like we do for the main category to display the image.
The query should be like this:
SELECT * FROM jos_hikashop_file WHERE file_ref_id='CATEGORY_ID' AND file_type='category';
where you need to replace the CATEGORY_ID with the actual id of the category.

Please Log in or Create an account to join the conversation.

  • Posts: 5
  • Thank you received: 0
13 years 11 months ago #4413

Thank you for the quick response!

Please Log in or Create an account to join the conversation.

Time to create page: 0.056 seconds
Powered by Kunena Forum