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

#   Display no Specifications when no are available

##

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

Less More

- Posts: 110
- Thank you received: 4
-
-

12 years 11 months ago [\#135066](#135066) by [mike](/forum/user/8167-mike "View mike's Profile")  *[Display no Specifications when no are available](/forum/3-bug-report/864085-display-no-specifications-when-no-are-available#135066 "-- url of the page with the problem -- :   www.waffenmarti.ch/shop  -- HikaShop version -- : HikaShop &#91;1308241414&#93; / -- Joomla version -- : 2.5.14 -- PHP version -- : 5.3.27 -- Browser(s) name and version -- : 31.0.1650.57 (Official Build 235101) -- Error-message(debug-mod must be tuned on) -- : No error message / miss behave  Hello there  I have a problem with the custom fields / specification feature. I have on the products table some custom fields defined (via the Hika-Shop-Interface of course). I have a flag &quot;Special Online Sale&quot; and I use that boolean type field for internal stuff. I said, that this flag shall not be displayed on the front-end. I have other flags also booleans that shall be displayed on the front-end (like if the product need a license or not).  Now, i have the problem that all products has the specifications table on their page, but some product has nothing to display.  E.g. this one...   www.waffenmarti.ch/shop/waffenreinigung/...l-remington-oel.html  This Oil has no flags, but the Specifications-Title (Wichtige Produktehinweise) is displayed, regardless if there are specification or not.  How can I avoid that. If there are no flags set, then no title shall be displayed. Best regards Michael")* was created by *[mike](/forum/user/8167-mike "View mike's Profile")*

-- url of the page with the problem -- : [ www.waffenmarti.ch/shop](http://www.waffenmarti.ch/shop)
-- HikaShop version -- : HikaShop [1308241414] /
-- Joomla version -- : 2.5.14
-- PHP version -- : 5.3.27
-- Browser(s) name and version -- : 31.0.1650.57 (Official Build 235101)
-- Error-message(debug-mod must be tuned on) -- : No error message / miss behave

Hello there

I have a problem with the custom fields / specification feature. I have on the products table some custom fields defined (via the Hika-Shop-Interface of course). I have a flag "Special Online Sale" and I use that boolean type field for internal stuff. I said, that this flag shall not be displayed on the front-end. I have other flags also booleans that shall be displayed on the front-end (like if the product need a license or not).

Now, i have the problem that all products has the specifications table on their page, but some product has nothing to display.

E.g. this one...
[ www.waffenmarti.ch/shop/waffenreinigung/...l-remington-oel.html](https://www.waffenmarti.ch/shop/waffenreinigung/oele-und-fette/produkt/24-rem-oil-remington-oel.html)

This Oil has no flags, but the Specifications-Title (Wichtige Produktehinweise) is displayed, regardless if there are specification or not.

How can I avoid that. If there are no flags set, then no title shall be displayed.
Best regards
Michael

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

Less More

- Posts: 86564
- Thank you received: 14311
-
-

12 years 11 months ago [\#135209](#135209) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Display no Specifications when no are available](/forum/3-bug-report/864085-display-no-specifications-when-no-are-available#135209 "-- url of the page with the problem -- :   www.waffenmarti.ch/shop  -- HikaShop version -- : HikaShop &#91;1308241414&#93; / -- Joomla version -- : 2.5.14 -- PHP version -- : 5.3.27 -- Browser(s) name and version -- : 31.0.1650.57 (Official Build 235101) -- Error-message(debug-mod must be tuned on) -- : No error message / miss behave  Hello there  I have a problem with the custom fields / specification feature. I have on the products table some custom fields defined (via the Hika-Shop-Interface of course). I have a flag &quot;Special Online Sale&quot; and I use that boolean type field for internal stuff. I said, that this flag shall not be displayed on the front-end. I have other flags also booleans that shall be displayed on the front-end (like if the product need a license or not).  Now, i have the problem that all products has the specifications table on their page, but some product has nothing to display.  E.g. this one...   www.waffenmarti.ch/shop/waffenreinigung/...l-remington-oel.html  This Oil has no flags, but the Specifications-Title (Wichtige Produktehinweise) is displayed, regardless if there are specification or not.  How can I avoid that. If there are no flags set, then no title shall be displayed. Best regards Michael")*

Hi,

You would have to edit the file "show_block_custom_main" via the menu Display&gt;Views and change its code to: Code:

&lt;?php $this-&gt;fieldsClass-&gt;prefix = ''; $displayTitle = false; ob_start(); foreach ($this-&gt;fields as $fieldName =&gt; $oneExtraField) { $value = ''; if(empty($this-&gt;element-&gt;$fieldName) &amp;&amp; !empty($this-&gt;element-&gt;main-&gt;$fieldName))$this-&gt;element-&gt;$fieldName = $this-&gt;element-&gt;main-&gt;$fieldName; if(isset($this-&gt;element-&gt;$fieldName)) $value = trim($this-&gt;element-&gt;$fieldName); if (!empty ($value)) { $displayTitle = true; ?&gt; &lt;tr class="hikashop_product_custom_&lt;?php echo $oneExtraField-&gt;field_namekey;?&gt;_line"&gt; &lt;td class="key"&gt; &lt;span id="hikashop_product_custom_name_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_product_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_product_custom_value_&lt;?php echo $oneExtraField-&gt;field_id;?&gt;" class="hikashop_product_custom_value"&gt; &lt;?php echo $this-&gt;fieldsClass-&gt;show($oneExtraField,$value); ?&gt; &lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php } } $specifFields = ob_get_clean(); if($displayTitle){ ?&gt; &lt;div id="hikashop_product_custom_info_main" class="hikashop_product_custom_info_main"&gt; &lt;h4&gt;&lt;?php echo JText::_('SPECIFICATIONS');?&gt;&lt;/h4&gt; &lt;table width="100%"&gt; &lt;?php echo $specifFields; ?&gt; &lt;/table&gt; &lt;/div&gt; &lt;?php }

The following user(s) said Thank You: [mike](/forum/user/8167-mike "View mike's Profile"), [pepecortez](/forum/user/31475-pepecortez "View pepecortez's Profile")

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

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

Less More

- Posts: 110
- Thank you received: 4
-
-

12 years 11 months ago [\#135745](#135745) by [mike](/forum/user/8167-mike "View mike's Profile")  Replied by *[mike](/forum/user/8167-mike "View mike's Profile")* on topic *[Display no Specifications when no are available](/forum/3-bug-report/864085-display-no-specifications-when-no-are-available#135745 "-- url of the page with the problem -- :   www.waffenmarti.ch/shop  -- HikaShop version -- : HikaShop &#91;1308241414&#93; / -- Joomla version -- : 2.5.14 -- PHP version -- : 5.3.27 -- Browser(s) name and version -- : 31.0.1650.57 (Official Build 235101) -- Error-message(debug-mod must be tuned on) -- : No error message / miss behave  Hello there  I have a problem with the custom fields / specification feature. I have on the products table some custom fields defined (via the Hika-Shop-Interface of course). I have a flag &quot;Special Online Sale&quot; and I use that boolean type field for internal stuff. I said, that this flag shall not be displayed on the front-end. I have other flags also booleans that shall be displayed on the front-end (like if the product need a license or not).  Now, i have the problem that all products has the specifications table on their page, but some product has nothing to display.  E.g. this one...   www.waffenmarti.ch/shop/waffenreinigung/...l-remington-oel.html  This Oil has no flags, but the Specifications-Title (Wichtige Produktehinweise) is displayed, regardless if there are specification or not.  How can I avoid that. If there are no flags set, then no title shall be displayed. Best regards Michael")*

Hello Nicolas

I added the code and it worked fine! Thank you very much for your help!
Here you can see the result!

[ www.waffenmarti.ch/shop/waffenreinigung/...l-remington-oel.html](https://www.waffenmarti.ch/shop/waffenreinigung/oele-und-fette/produkt/24-rem-oil-remington-oel.html)
(shows no information!)

[ www.waffenmarti.ch/shop/diverse-gewehre/...liber-12-20-410.html](https://www.waffenmarti.ch/shop/diverse-gewehre/baikal/produkt/264-baikal-bockdoppelflinte-kaliber-12-20-410.html)
(show, the additional information!)

Very nice! Thank you for your help!
Best regards
Mike

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

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