Sound Player on Variants Pages Fails to Load

  • Posts: 29
  • Thank you received: 1
7 years 6 months ago #281672

-- url of the page with the problem -- : beautiful-spirit.com/index.php/he/tibet-tester
-- HikaShop version -- : 3.2.1
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.6.30
-- Browser(s) name and version -- : Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:56.0) Gecko/20100101 Firefox/56.0

Hi,

I have several sizes of a product (Tibetan singing bowl). Each produces a different sound.
On each product variant page, I place a different HTML with a sound player (Simple Audio Player - Shortcode) and a reference to the appropriate sound file.
Upon a first load of the page, the player works well. I even tested it with two different soundtracks on the same page.
As soon as I switch to a variant using the drop-down list box, the player stops working.

It is clear to me that it has something to do with dynamic loading or code or something similar.
I really must have it as variants and not as separate product page for each diameter of the bowl.

Any suggestions, please?

Thanks in advance.

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

  • Posts: 26232
  • Thank you received: 4035
  • MODERATOR
7 years 6 months ago #281675

Hello,

You would need to perform some big modifications in the product page if you want to have a different kind of "switch" of content for the variants.
HikaShop is currently doing it by copying the HTML content in some hidden div into the corresponding div in the product page.
It's working very good for almost every content except element which are initialized with some javascript.
So in your case, you'll need to not perform the copy of content but more doing a "hide & display" of blocks ; or you can keep the copy but you'll need to add some javascript to re-initialized the player.

www.hikashop.com/support/documentation/1...-display.html#layout

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.
The following user(s) said Thank You: bshomer

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

  • Posts: 29
  • Thank you received: 1
7 years 6 months ago #281743

Thanks Jerome,

Hmmm.... That's a bummer.

In that case, trying to avoid a huge hassle, can you give me another tip?

Is there a constant section which I can hook into, which does not change when a variant is selected?
This way, the initialization will be made once when the page is loaded and even when a variant is selected, the code will work.
This way, I'll simply create a modal with all soundtracks for all variants together.
Not the most elegant solution, but I cannot invest so much now in re-writing the product page code only for that.

Thanks very much.

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

  • Posts: 26232
  • Thank you received: 4035
  • MODERATOR
7 years 6 months ago #281782

Hello,

You can take a look at the view "product / show" to see the blocks generated for the variants.
If you change your product page (product / show_default) if you add your custom content and if it's not in the specific div (that you can found via their ID), your content will be considered as "static".
I hope that my explanation is clear enough.

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.
The following user(s) said Thank You: bshomer

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

  • Posts: 29
  • Thank you received: 1
7 years 6 months ago #281866

That was very clear.
Thank you very much!!!

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

Time to create page: 0.156 seconds
Powered by Kunena Forum