Custom Field File - Hide if empty

  • Posts: 147
  • Thank you received: 6
11 years 2 weeks ago #168809

-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3

Hi Guys, I created a couple of custom fields of the type file for products which I will use to upload specs and pds.
The problem is that not all the products have pdf specs and pds available so I want the field to only appear if not empty.

I created an override for the show_block_custom_main.php I think I am doing something wrong.

I appreciate if you could help.

Thanks.

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

  • Posts: 147
  • Thank you received: 6
11 years 2 weeks ago #168826

Hi I sorted it out.
I think there is an error in show_block_custom_main.php
it checks if the field is empty but then if it is igual 0
So it will show the field label either way.
I just changed it to
if (!empty ($value) || $value != 0)

And it is all sorted.
;)

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

Time to create page: 0.043 seconds
Powered by Kunena Forum