Not reading script in product tab

  • Posts: 256
  • Thank you received: 2
6 years 4 months ago #284334

-- url of the page with the problem -- : mirageweddingbackdrops.co.uk/dev/mirage-...flower-wall-backdrop

Hello,
I am using a tab gallery selector in one of my product tabs, However it doesn't seem to want to read the script.
I have placed the script at the bottom of the index.php file and all the HTML within in the custom field tab.

I have tested in a regular Joomla article and it all works fine.
What would be preventing it to read the script in the custom field tab.

I have provided the exact page above and the issue is under tab 'style & colour'
It currently displays 4 images and when clicked on it should display a large image below them

Thanks

Attachments:

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

  • Posts: 81540
  • Thank you received: 13069
  • MODERATOR
6 years 4 months ago #284354

Hi,

What is this tab gallery selector ?
If it's a content plugin, then it's normal that it doesn't work if you don't call the content.prepare trigger on your tab content like that:
echo JHTML::_('content.prepare', $content);

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

  • Posts: 256
  • Thank you received: 2
6 years 4 months ago #284376

Hello,
No its not a plugin. I have added the script into the index.php file to function and everything else is HTML and CSS.

Do I just add that PHP into the show_tabular.
I have attached what the tab section looks like under show_tabular

Here is the link to the Tab Gallery Selector I am trying to reproduce as an example of its function.
www.w3schools.com/howto/howto_js_tab_img_gallery.asp

Thanks

Attachments:

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

  • Posts: 26007
  • Thank you received: 4004
  • MODERATOR
6 years 4 months ago #284386

Hello,

Your question is unfortunately not related to HikaShop or our support.
Please open your browser console and you will see some JS errors (which are not related to HikaShop).
These are the reason why your JS is not processed.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 256
  • Thank you received: 2
6 years 4 months ago #284481

Hello,
I have got rid of all the errors except the displayTab error which is to do with the tabs gallery itself.
However I have just checked and this error does not appear in a regular article. Therefore it is something to do with Hikashop causing this conflict.
Example of it working on this page here:
mirageweddingbackdrops.co.uk/dev/mirage-privacy-policy

I am trying to figure out what this means and why it is only appearing when used in Hikashop Tabular.
Uncaught ReferenceError: displayTab is not defined
at HTMLAnchorElement.onclick


Can you help find out the reason this error is displaying?

Thanks

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

  • Posts: 81540
  • Thank you received: 13069
  • MODERATOR
6 years 4 months ago #284482

Hi,
The displayTab is not to do with the tabs gallery. It comes from the tabs of product page:
monosnap.com/file/Lk0n2EG03bf7fHQkclh0NrPUgqBaWp
For some reason, you have something adding that a tag inside the tabs of your tabular layout calling a javascript function which doesn't exist.
Because of that, the javascript of your image gallery system is not initialized and it doesn't work.
Note that there is no displayTab javascript by default in HikaShop or in the show_tabular view file.

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

  • Posts: 256
  • Thank you received: 2
6 years 4 months ago #284533

Ha right okay,
I originally copied that php code to add the custom fields as tabs. Removing the onclick displayTab from the php removes the js error and the tabs still function as should. However it has still not resolved the issue I began with.

Why the tab gallery I have added is not working within Hikashop?

Thanks for your help so far.

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

  • Posts: 81540
  • Thank you received: 13069
  • MODERATOR
6 years 4 months ago #284538

Hi,

Ok, I've looked into it.
The issue is with your script code.
If you look at the javascript it uses, you can see that it basically adds the URL of the image in the img tag with the id expandedImg.
However, if you look at the HTML of the page, you can see that you have twice the gallery on the page with twice the img tag with the id expandedImg:
monosnap.com/file/hXFJ2q0F2YDwImnZk12PBjkLfomF95
Now, this is not valid HTML and cannot work, even in a joomla article. If you add two galleries with your code in a Joomla article, you'll see that it doesn't work properly either.
Please understand that we're not supposed to help with debugging your customizations...

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

  • Posts: 256
  • Thank you received: 2
6 years 4 months ago #284648

Hello,
Thankyou for helping me out. The reason it was repeating was because the specification tab was also calling in all of the custom fields as well as my own custom tab fields. Commenting out the specification in the view file as resolved this issue.

Thanks again really appreciate it.

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

  • Posts: 12953
  • Thank you received: 1778
6 years 4 months ago #284649

Hello,

Thank you for your feedback !

Best regards,
Mohamed Thelji

Last edit: 6 years 4 months ago by Mohamed Thelji.

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

Time to create page: 0.092 seconds
Powered by Kunena Forum