Moving downloads to a tab

  • Posts: 22
  • Thank you received: 1
5 years 10 months ago #306075

-- HikaShop version -- : 4.0.3
-- Joomla version -- : 3.9.5
-- PHP version -- : 7.0

Hi friends,

I'm trying to do something that I thought would be simple, but I must have gone wrong somewhere. What I want is to MOVE the "Downloads" section of the product page into a tab. I've modified the show_tabular view and added the code from the downloads section. It's working initially, but when clicking on another tab the downloads section doesn't go away. I've attached my view file and hope you can point me in the right direction -- my code starts at line 231. I know this isn't something you normally do but I'm hoping it's a simple fix.

Thank you very much!

Attachments:
Last edit: 5 years 10 months ago by DavidVogt.

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

  • Posts: 83483
  • Thank you received: 13505
  • MODERATOR
5 years 10 months ago #306087

Hi,

You need to separate your code.
The tabs system is comprised of two pieces:
- the ul/li list of the titles for each tab
- the divs with the content of each tab

I can see that you put the div with the content of your new tab right after the title of your new tab inside the ul/li list of the titles.
You should move the div with the content of your new tab after/before another tab's content div. For example, just before the line:

if($status_vote == "comment" || $status_vote == "two" || $status_vote == "both" ) { ?>
which is the beginning of the content div for the vote/comment tab.

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

  • Posts: 22
  • Thank you received: 1
5 years 10 months ago #306117

THANK YOU! That was super helpful, Nicolas. The tabs now seem to be working properly with the downloads showing. One final problem: In some products, the tab is showing, but the files are not there.

It works here:
fisher.sptlt.com/products/gold-treasure/...r-f11-metal-detector

It doesn't work here:
fisher.sptlt.com/products/security/evide...urity-metal-detector

Any insight would be greatly appreciated!

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

  • Posts: 4820
  • Thank you received: 654
  • MODERATOR
5 years 10 months ago #306123

Hello,

I don't see any important issue with your code, why don't you make a var_dump on your "$this->element->files" in order to see if there is something different, or maybe you have a check that don't match a specific case ?...
Maybe for a reason or another "$this->element->files" is empty, and so you don't enter in your "if($freeDownload)" check ?...
So far and whithout debug hard to say more.

Hope this will help you.

Regards

Last edit: 5 years 10 months ago by Philip.

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

Time to create page: 0.067 seconds
Powered by Kunena Forum