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

#   Display category description when empty category

##

- **[fabius](/forum/user/43627-fabius "View fabius's Profile")**
- [![fabius's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/43627-fabius "View fabius's Profile") Topic Author
- [ Offline](/forum/user/43627-fabius)

Less More

- Posts: 9
- Thank you received: 0
-
-

9 years 10 months ago [\#259308](#259308) by [fabius](/forum/user/43627-fabius "View fabius's Profile")  *[Display category description when empty category](/forum/26-product-category-display/888270-display-category-description-when-empty-category#259308 "-- HikaShop version -- : 2.6.4  Hello, I would like to know how to make possible to show category description also if category is empty. Is there a way? I tried so hard but did not manage to find solution. Can somebody help me? Thanks")* was created by *[fabius](/forum/user/43627-fabius "View fabius's Profile")*

-- HikaShop version -- : 2.6.4

Hello,
I would like to know how to make possible to show category description also if category is empty.
Is there a way?
I tried so hard but did not manage to find solution.
Can somebody help me?
Thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODgyNzAtZGlzcGxheS1jYXRlZ29yeS1kZXNjcmlwdGlvbi13aGVuLWVtcHR5LWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

9 years 10 months ago [\#259333](#259333) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display category description when empty category](/forum/26-product-category-display/888270-display-category-description-when-empty-category#259333 "-- HikaShop version -- : 2.6.4  Hello, I would like to know how to make possible to show category description also if category is empty. Is there a way? I tried so hard but did not manage to find solution. Can somebody help me? Thanks")*

Hi,

Edit all the code instances of :
if(!empty($html))
to:
if(true)
in the file "listing" of the view "category" for your frontend template and that should do it.

[ www.hikashop.com/support/documentation/1...ize-the-display.html](https://www.hikashop.com/support/documentation/153-customize-the-display.html)

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

- **[fabius](/forum/user/43627-fabius "View fabius's Profile")**
- [![fabius's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/43627-fabius "View fabius's Profile") Topic Author
- [ Offline](/forum/user/43627-fabius)

Less More

- Posts: 9
- Thank you received: 0
-
-

9 years 10 months ago -  9 years 10 months ago [\#259436](#259436) by [fabius](/forum/user/43627-fabius "View fabius's Profile")  Replied by *[fabius](/forum/user/43627-fabius "View fabius's Profile")* on topic *[Display category description when empty category](/forum/26-product-category-display/888270-display-category-description-when-empty-category#259436 "-- HikaShop version -- : 2.6.4  Hello, I would like to know how to make possible to show category description also if category is empty. Is there a way? I tried so hard but did not manage to find solution. Can somebody help me? Thanks")*

Hello,
It does not work.
you can see here [ mncsvilupp.assistenzalogo.it/index.php?o...ppe-gallo&amp;Itemid=285](http://mncsvilupp.assistenzalogo.it/index.php?option=com_hikashop&ctrl=category&task=listing&cid=14&name=giuseppe-gallo&Itemid=285)

there are no products in this category and the description is not showing.
I also paste listing.php edit file: Code:

&lt;?php /** * @package HikaShop for Joomla! * @version 2.6.1 * @author hikashop.com * @copyright (C) 2010-2016 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;?php ob_start(); if(version_compare(JVERSION,'1.6','&lt;')){ $title = 'show_page_title'; }else{ $title = 'show_page_heading'; } $titleType='h1'; if($this-&gt;module){ $title = 'showtitle'; $titleType='h2'; } if($this-&gt;params-&gt;get($title) &amp;&amp; JRequest::getVar('hikashop_front_end_main',0)){ if($this-&gt;module){ $heading = $this-&gt;params-&gt;get('title'); }else{ $heading = $this-&gt;params-&gt;get('page_title'); if($this-&gt;params-&gt;get('page_heading')){ $heading = $this-&gt;params-&gt;get('page_heading'); } } ?&gt; &lt;&lt;?php echo $titleType; ?&gt;&gt; &lt;?php echo $heading; ?&gt; &lt;/&lt;?php echo $titleType; ?&gt;&gt; &lt;?php } if(!$this-&gt;module){ if(isset($this-&gt;element-&gt;category_canonical) &amp;&amp; !empty($this-&gt;element-&gt;category_canonical)){ $canonicalUrl = hikashop_cleanURL($this-&gt;element-&gt;category_canonical); $doc = JFactory::getDocument(); $doc-&gt;addCustomTag( '&lt;link rel="canonical" href="'.$canonicalUrl.'" /&gt;' ); } if(($this-&gt;params-&gt;get('show_image') &amp;&amp; !empty($this-&gt;element-&gt;file_path))&#124;&#124; ($this-&gt;params-&gt;get('show_description')&amp;&amp;!empty($this-&gt;element-&gt;category_description))){ ?&gt; &lt;div class="hikashop_category_description"&gt; &lt;?php if($this-&gt;params-&gt;get('show_image') &amp;&amp; !empty($this-&gt;element-&gt;file_path)){ jimport('joomla.filesystem.file'); if(JFile::exists($this-&gt;image-&gt;getPath($this-&gt;element-&gt;file_path,false))){ ?&gt; &lt;img src="&lt;?php echo $this-&gt;image-&gt;getPath($this-&gt;element-&gt;file_path); ?&gt;" class="hikashop_category_image" title="&lt;?php echo $this-&gt;escape(@$this-&gt;element-&gt;file_description); ?&gt;" alt="&lt;?php echo $this-&gt;escape(@$this-&gt;element-&gt;file_name); ?&gt;"/&gt; &lt;?php } } if($this-&gt;params-&gt;get('show_description',1)&amp;&amp;!empty($this-&gt;element-&gt;category_description)){ ?&gt; &lt;?php } ?&gt; &lt;/div&gt; &lt;?php } if(!empty($this-&gt;fields)){ ?&gt; &lt;?php ob_start(); $this-&gt;fieldsClass-&gt;prefix = ''; foreach($this-&gt;fields as $fieldName =&gt; $oneExtraField) { if(!empty($this-&gt;element-&gt;$fieldName)){ ?&gt; &lt;tr class="hikashop_category_custom_&lt;?php echo $oneExtraField-&gt;field_namekey;?&gt;_line"&gt; &lt;td class="key"&gt; &lt;span id="hikashop_category_custom_name_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_category_custom_name"&gt; &lt;?php echo $this-&gt;fieldsClass-&gt;getFieldName($oneExtraField);?&gt; &lt;/span&gt; &lt;/td&gt; &lt;td&gt; &lt;span id="hikashop_category_custom_value_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_category_custom_value"&gt; &lt;?php echo $this-&gt;fieldsClass-&gt;show($oneExtraField,$this-&gt;element-&gt;$fieldName); ?&gt; &lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php } } $custom_fields_html = ob_get_clean(); if(!empty($custom_fields_html)){ ?&gt; &lt;div id="hikashop_category_custom_info_main" class="hikashop_category_custom_info_main"&gt; &lt;h4&gt;&lt;?php echo JText::_('CATEGORY_ADDITIONAL_INFORMATION');?&gt;&lt;/h4&gt; &lt;table width="100%"&gt; &lt;?php echo $custom_fields_html; ?&gt; &lt;/table&gt; &lt;/div&gt; &lt;?php } } } $layout_type = $this-&gt;params-&gt;get('layout_type'); if(empty($layout_type) &#124;&#124; $layout_type=='table') $layout_type = 'div'; $html = $this-&gt;loadTemplate($layout_type); if(true) echo '&lt;div class="hikashop_subcategories_listing"&gt;'.$html.'&lt;/div&gt;'; if(!$this-&gt;module){ $data = $this-&gt;params-&gt;get('data'); if(isset($data-&gt;hk_product) &amp;&amp; is_object($data-&gt;hk_product)){ $js = ''; $empty=''; jimport('joomla.html.parameter'); $params = new HikaParameter($empty); foreach($data-&gt;hk_product as $k =&gt; $v){ $params-&gt;set($k,$v); } $main_div_name = 'hikashop_category_information_module_'.$params-&gt;get('id'); $params-&gt;set('main_div_name',$main_div_name); echo '&lt;div class="hikashop_submodules" style="clear:both"&gt;'.hikashop_getLayout('product', 'listing', $params, $js).'&lt;/div&gt;'; } else if(!empty($this-&gt;modules)){ $html = ''; jimport('joomla.application.module.helper'); foreach($this-&gt;modules as $module){ $html .= JModuleHelper::renderModule($module); } if(true){ echo '&lt;div class="hikashop_submodules" style="clear:both"&gt;'.$html.'&lt;/div&gt;'; } } } $html = ob_get_clean(); if(true){ $category_id = 0; if(!empty($this-&gt;element-&gt;category_id)) $category_id = $this-&gt;element-&gt;category_id; if(!empty($this-&gt;row-&gt;category_id)) $category_id = $this-&gt;row-&gt;category_id; ?&gt; &lt;div id="&lt;?php echo $this-&gt;params-&gt;get('main_div_name');?&gt;" class="hikashop_category_information hikashop_categories_listing_main hikashop_category_listing_&lt;?php echo $category_id; ?&gt;"&gt; &lt;?php echo $html; ?&gt; &lt;/div&gt; &lt;?php } ?&gt;

Last edit: 9 years 10 months ago by [nicolas](/forum/user/63-nicolas "View nicolas's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODgyNzAtZGlzcGxheS1jYXRlZ29yeS1kZXNjcmlwdGlvbi13aGVuLWVtcHR5LWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

9 years 10 months ago [\#259442](#259442) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display category description when empty category](/forum/26-product-category-display/888270-display-category-description-when-empty-category#259442 "-- HikaShop version -- : 2.6.4  Hello, I would like to know how to make possible to show category description also if category is empty. Is there a way? I tried so hard but did not manage to find solution. Can somebody help me? Thanks")*

Hi,

And you're sure that the description displays if there are products in the category ?
If you add a product in that category with the id 14, you get the description ?
To me it looks like you have the "show description" setting turned off in your menu item and that the description of the main category won't display regardless of the products in the category.
Can you check on that ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84ODgyNzAtZGlzcGxheS1jYXRlZ29yeS1kZXNjcmlwdGlvbi13aGVuLWVtcHR5LWNhdGVnb3J5P3RtcGw9bWFya2Rvd24=) 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.054 seconds

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