Description tab hide

  • Posts: 121
  • Thank you received: 1
9 years 3 months ago #228477

-- HikaShop version -- : 2.4
-- Joomla version -- : 3.4.8

Hi,
on my product page I've create a specific field for category product and I have add the code on my show_file.php

<ul>
                <li class="active"><a href="#" class=""><?php echo JText::_('TPL_ITEM_PRODUCT_DESCRIZIONE'); ?></a></li>
                <li class=""><a href="#" class=""><?php echo JText::_('TPL_ITEM_PRODUCT_VENDITA'); ?></a></li>
                <li class=""><a href="#" class=""><?php echo JText::_('TPL_ITEM_PRODUCT_SCHEDA'); ?></a></li>
                <li class=""><a href="#" class=""><?php echo JText::_('TPL_ITEM_PRODUCT_INFORMAZIONI'); ?></a></li>
            </ul>
<div class="tab-panel vendita">
                	<div id="hikashop_product_bottom_part" class="hikashop_product_bottom_part hikashop_product_description_main list-item last-list">
      		          	<?php echo $this->element->vendita ?>
                	</div>
                </div>
                <div class="tab-panel scheda">
                	<div id="hikashop_product_bottom_part" class="hikashop_product_bottom_part hikashop_product_description_main list-item last-list">
      		          	<?php echo $this->element->schedatecnica ?>
                	</div>
                </div>

I'd like that the content on <li> tag are empty also the <li> doesn't see. example:
the second li isn't empty for the category one, so for the product of this category this tag is visible; but for category two this is empty so the content and the <li> tag are doing hidden.

How can I do this?

I hope that I explained me
Thanks
Matteo

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

  • Posts: 83766
  • Thank you received: 13555
  • MODERATOR
9 years 3 months ago #228502

Hi,

I'm sorry but I don't understand what you want to hide and when you want to hide it ? Could you maybe provide some screenshots to better explain the issue ?

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

  • Posts: 121
  • Thank you received: 1
9 years 3 months ago #228624

Sorry,
If you see the tab "scheda tecnica" is empty, so I'd like that tab is hide, how can I do this?

Thanks
Matteo

Attachments:

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

  • Posts: 83766
  • Thank you received: 13555
  • MODERATOR
9 years 3 months ago #228649

Hi,

It's simple PHP.
Instead of :
<li class=""><a href="#" class=""><?php echo JText::_('TPL_ITEM_PRODUCT_SCHEDA'); ?></a></li>

you can use such code:
<?php if(!empty($this->element->schedatecnica)){ ?>
<li class=""><a href="#" class=""><?php echo JText::_('TPL_ITEM_PRODUCT_SCHEDA'); ?></a></li>
<?php } ?>

The following user(s) said Thank You: m.fontana

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

  • Posts: 121
  • Thank you received: 1
9 years 3 months ago #228676

Thanks so much,
now I have another problem, the tab "descrizione" have class="active", so when I see the product without this tab the content of the other is hidden; how can I do for add automatically the class="active" for the first tab?

Thanks
Matteo

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

  • Posts: 83766
  • Thank you received: 13555
  • MODERATOR
9 years 3 months ago #228697

Hi,

I don't know how your tab system works. So I don't know how to add such class automatically.

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

Time to create page: 0.062 seconds
Powered by Kunena Forum