[Skip to main content](#vessel-content)

#   How to display subcategory images on category page

##

- **[spavanes](/forum/user/35434-spavanes "View spavanes's Profile")**
- [![spavanes's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar35434.jpg)](/forum/user/35434-spavanes "View spavanes's Profile") Topic Author
- [ Offline](/forum/user/35434-spavanes)

Less More

- Posts: 3
- Thank you received: 0
-
-
-
-

11 years 1 month ago [\#213607](#213607) by [spavanes](/forum/user/35434-spavanes "View spavanes's Profile")  *[How to display subcategory images on category page](/forum/26-product-category-display/879161-how-to-display-subcategory-images-on-category-page#213607 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.3 -- PHP version -- : 5.4.41  I tried to edit the category listing&#95;div.php to add subcategory images instead of the subcategory name below the current category. But I can't figure out how to get there.  This is what I already have, but I can't get the image of the subcategory:  Can someone please help me with this?  Thank you very much!")* was created by *[spavanes](/forum/user/35434-spavanes "View spavanes's Profile")*

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.3
-- PHP version -- : 5.4.41

I tried to edit the category listing_div.php to add subcategory images instead of the subcategory name below the current category. But I can't figure out how to get there.

This is what I already have, but I can't get the image of the subcategory:
Code:

&lt;?php $image_options = array('default' =&gt; true,'forcesize' =&gt; $this-&gt;config-&gt;get('image_force_size', true),'scale' =&gt; $this-&gt;config-&gt;get('image_scale_mode', 'inside')); $img = $this-&gt;image-&gt;getThumbnail(@$this-&gt;row-&gt;file_path, array('width' =&gt; $this-&gt;image-&gt;main_thumbnail_x, 'height' =&gt; $this-&gt;image-&gt;main_thumbnail_y), $image_options); if($img-&gt;success) { echo '&lt;img class="hikashop_product_listing_image" title="'.$this-&gt;escape(@$this-&gt;row-&gt;file_name).'" alt="'.$this-&gt;escape(@$this-&gt;row-&gt;file_name).'" src="'.$img-&gt;url.'" width="60px" height="35px" /&gt;'; } /* echo $child-&gt;category_name; if($this-&gt;params-&gt;get('number_of_products',0)) { echo ' ('.$child-&gt;number_of_products.')'; } */ ?&gt;

Can someone please help me with this?

Thank you very much!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxNjEtaG93LXRvLWRpc3BsYXktc3ViY2F0ZWdvcnktaW1hZ2VzLW9uLWNhdGVnb3J5LXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

11 years 1 month ago [\#213615](#213615) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[How to display subcategory images on category page](/forum/26-product-category-display/879161-how-to-display-subcategory-images-on-category-page#213615 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.3 -- PHP version -- : 5.4.41  I tried to edit the category listing&#95;div.php to add subcategory images instead of the subcategory name below the current category. But I can't figure out how to get there.  This is what I already have, but I can't get the image of the subcategory:  Can someone please help me with this?  Thank you very much!")*

Hi,

You can just use a more appropriated layout for the category listing ; like the "img title" one which display the category images directly.
[ www.hikashop.com/support/documentation/i...-menus-form.html#div](http://www.hikashop.com/support/documentation/integrated-documentation/10-hikashop/47-hikashop-menus-form.html#div)

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxNjEtaG93LXRvLWRpc3BsYXktc3ViY2F0ZWdvcnktaW1hZ2VzLW9uLWNhdGVnb3J5LXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[spavanes](/forum/user/35434-spavanes "View spavanes's Profile")**
- [![spavanes's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar35434.jpg)](/forum/user/35434-spavanes "View spavanes's Profile") Topic Author
- [ Offline](/forum/user/35434-spavanes)

Less More

- Posts: 3
- Thank you received: 0
-
-
-
-

11 years 1 month ago [\#213693](#213693) by [spavanes](/forum/user/35434-spavanes "View spavanes's Profile")  Replied by *[spavanes](/forum/user/35434-spavanes "View spavanes's Profile")* on topic *[How to display subcategory images on category page](/forum/26-product-category-display/879161-how-to-display-subcategory-images-on-category-page#213693 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.3 -- PHP version -- : 5.4.41  I tried to edit the category listing&#95;div.php to add subcategory images instead of the subcategory name below the current category. But I can't figure out how to get there.  This is what I already have, but I can't get the image of the subcategory:  Can someone please help me with this?  Thank you very much!")*

Thank you Jerome for the quick response on this.

But configure the category listing, I get the subcategories below all main categories. I like to get the subcategory images below each main categorie, illustrated in the attachment. I think it must be possible because hikashop is such a flexible system, but I can not figure out how.

- [ ![main-&#95;subcategories.jpg](/forum/attachment/26368) ](/forum/attachment/26368 "...categories.jpg") [ ](/forum/attachment/26368?download=1 "...categories.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxNjEtaG93LXRvLWRpc3BsYXktc3ViY2F0ZWdvcnktaW1hZ2VzLW9uLWNhdGVnb3J5LXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86290
- Thank you received: 14268
-
-

11 years 1 month ago [\#213718](#213718) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[How to display subcategory images on category page](/forum/26-product-category-display/879161-how-to-display-subcategory-images-on-category-page#213718 "-- HikaShop version -- : 2.5.0 -- Joomla version -- : 3.4.3 -- PHP version -- : 5.4.41  I tried to edit the category listing&#95;div.php to add subcategory images instead of the subcategory name below the current category. But I can't figure out how to get there.  This is what I already have, but I can't get the image of the subcategory:  Can someone please help me with this?  Thank you very much!")*

Hi,

It's indeed the listing_div file of the category view that you want to edit.
There you will have first to load the images of the sub categories from your MySQL database with a MySQL query on the hikashop_file table. Then, you'll be able to use PHP code similar to what you have on your first post to display the images instead of their name.

The following user(s) said Thank You: [spavanes](/forum/user/35434-spavanes "View spavanes's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84NzkxNjEtaG93LXRvLWRpc3BsYXktc3ViY2F0ZWdvcnktaW1hZ2VzLW9uLWNhdGVnb3J5LXBhZ2U/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.157 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
