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

#   Hide inactive button associated with custom field

##

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

Less More

- Posts: 431
- Thank you received: 19
-
-

9 years 7 months ago -  9 years 7 months ago [\#266300](#266300) by [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")  *[Hide inactive button associated with custom field](/forum/2-general-talk-about-hikashop/889617-hide-inactive-button-associated-with-custom-field#266300 "-- HikaShop version -- : 3.0.1  Hi I want to ask how can hide inactive button associated with custom field has no content. The goal is: made button associated with text custom field that will take the user to the official website of the product, but if for example there is no content in the field, the button to hide.  This is the button code")* was created by *[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")*

-- HikaShop version -- : 3.0.1

Hi I want to ask how can hide inactive button associated with custom field has no content. The goal is: made button associated with text custom field that will take the user to the official website of the product, but if for example there is no content in the field, the button to hide.

This is the button code Code:

&lt;div class="info-buttons"&gt; &lt;span class="website"&gt; &lt;?php $url = $this-&gt;element-&gt;website; $css_button = $this-&gt;config-&gt;get('css_button', 'hikabtn'); ?&gt; &lt;a href="&lt;?php echo $url; ?&gt;" class="&lt;?php echo $css_button; ?&gt;" target="_blank" data-toggle="tooltip" data-placement="top" title="Website"&gt; &lt;?php echo JText::_('&lt;i class="fa fa-globe" aria-hidden="true"&gt;&lt;/i&gt;'); ?&gt;&lt;/a&gt; &lt;/span&gt; &lt;/div&gt;

Last edit: 9 years 7 months ago by [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzg4OTYxNy1oaWRlLWluYWN0aXZlLWJ1dHRvbi1hc3NvY2lhdGVkLXdpdGgtY3VzdG9tLWZpZWxkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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: 86322
- Thank you received: 14281
-
-

9 years 7 months ago [\#266315](#266315) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Hide inactive button associated with custom field](/forum/2-general-talk-about-hikashop/889617-hide-inactive-button-associated-with-custom-field#266315 "-- HikaShop version -- : 3.0.1  Hi I want to ask how can hide inactive button associated with custom field has no content. The goal is: made button associated with text custom field that will take the user to the official website of the product, but if for example there is no content in the field, the button to hide.  This is the button code")*

Like that: Code:

&lt;?php if(!empty($this-&gt;element-&gt;website)){ ?&gt; &lt;div class="info-buttons"&gt; &lt;span class="website"&gt; &lt;?php $url = $this-&gt;element-&gt;website; $css_button = $this-&gt;config-&gt;get('css_button', 'hikabtn'); ?&gt; &lt;a href="&lt;?php echo $url; ?&gt;" class="&lt;?php echo $css_button; ?&gt;" target="_blank" data-toggle="tooltip" data-placement="top" title="Website"&gt; &lt;?php echo JText::_('&lt;i class="fa fa-globe" aria-hidden="true"&gt;&lt;/i&gt;'); ?&gt;&lt;/a&gt; &lt;/span&gt; &lt;/div&gt; &lt;?php } ?&gt;

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzg4OTYxNy1oaWRlLWluYWN0aXZlLWJ1dHRvbi1hc3NvY2lhdGVkLXdpdGgtY3VzdG9tLWZpZWxkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) to join the conversation.

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

Less More

- Posts: 431
- Thank you received: 19
-
-

9 years 7 months ago [\#266326](#266326) by [neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")  Replied by *[neo191987](/forum/user/35364-neo191987 "View neo191987's Profile")* on topic *[Hide inactive button associated with custom field](/forum/2-general-talk-about-hikashop/889617-hide-inactive-button-associated-with-custom-field#266326 "-- HikaShop version -- : 3.0.1  Hi I want to ask how can hide inactive button associated with custom field has no content. The goal is: made button associated with text custom field that will take the user to the official website of the product, but if for example there is no content in the field, the button to hide.  This is the button code")*

It works perfectly. Thank you. ![:)](/media/kunena/emoticons/3.png ":)")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzg4OTYxNy1oaWRlLWluYWN0aXZlLWJ1dHRvbi1hc3NvY2lhdGVkLXdpdGgtY3VzdG9tLWZpZWxkP3RtcGw9bWFya2Rvd24=) or [Create an account](/register) 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.070 seconds

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