Author Topic: Modal Popups do not work correctly in description of multi-variants  (Read 407 times)

brandiware

  • Beginner
  • *
  • Posts: 35
  • A beginner
Hi all,

when adding a modal popup in the product description of a multi-variant I get the following behaviour:

1. When the page is loaded first time the popup works fine
2. When another variant is chosen then the popup content is shown in a joomla frame (i.e. Start Page) rather than as a popup
3. When I refresh the page after selecting a multi-variant the popup works

I assume the some javascripting does not load immediately after variant switch ?

I can circumvent the problem using inline scripts like this (which leads me to my assumption):

<script src="https://www.w3schools.com/lib/w3.js"></script>

<a href="#openModal">HIER EIN BEISPIELPOPUP</a>

<div id="openModal" class="modalDialog" style="width:40%;heigth:60%;">
   <div>
      <a href="#close" title="Close" class="close">X</a>
      <div w3-include-html="index.php?option=com_content&view=article&id=446:das-ist-ein-beispiel-popup&catid=177&tmpl=article"></div>   
      <script>
      w3.includeHTML();
      </script>         
   </div>
</div>


Thanks for any help
Stefan

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 2974
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: Modal Popups do not work correctly in description of multi-variants
« Reply #1 on: February 09, 2018, 14:06:46 pm »
If you need dynamic code update, you have to add
Code: [Select]
jQuery('body').on('updateVirtueMartCartModule',function(){
//yourcode here
});
It's not the ultimate solution, but should work.
Else you can override the function on jquery ready
eg.
Code: [Select]
Virtuemart.cartEffect = function(form) {
//yourcode here
});
function cartEffect is an example, i don't checked exactly.

brandiware

  • Beginner
  • *
  • Posts: 35
  • A beginner
Re: Modal Popups do not work correctly in description of multi-variants
« Reply #2 on: February 13, 2018, 15:01:37 pm »
To Studio 42. Not quite sure I understand your suggestion. I would need to reload the Javascript underneath the popup plugin with the event that is
triggered when a product variant is selected.

Any idea where in the ProductDetail and Sublayouts this would need to happen ?

brandiware

  • Beginner
  • *
  • Posts: 35
  • A beginner
Re: Modal Popups do not work correctly in description of multi-variants
« Reply #3 on: February 13, 2018, 15:04:20 pm »
Does anyone know a commercial modal popup that works despite multi-variant selection (page load after multi-variant selection) ?

If not, I will have to stick with the html/CSS solution and expand that functionally.

Studio 42

  • Contributing Developer
  • Sr. Member
  • *
  • Posts: 2974
  • Joomla & Virtuemart addon developper
    • Studio 42 - Virtuemart & Joomla extentions
  • VirtueMart Version: 2.6 &amp; 3.0.x.y
Re: Modal Popups do not work correctly in description of multi-variants
« Reply #4 on: February 13, 2018, 17:10:11 pm »
Can you send a link to your shop, so i can check.
Perhaps you have already a compatible modal(eg using bootstrap modal or virtuemart core included fancybox modal)

Milbo

  • Virtuemart Projectleader
  • Administrator
  • Super Hero
  • *
  • Posts: 9561
  • VM3.2 Cached and Optimized
    • VM3 Extensions
  • VirtueMart Version: VirtueMart 3 on joomla 3
Re: Modal Popups do not work correctly in description of multi-variants
« Reply #5 on: February 19, 2018, 20:53:25 pm »
brandiware, we use also popups here and there. Check the popup of the "ask a question" it maybe gives you an idea how todo it.
I should fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

brandiware

  • Beginner
  • *
  • Posts: 35
  • A beginner
Re: Modal Popups do not work correctly in description of multi-variants
« Reply #6 on: March 22, 2018, 11:02:10 am »
Milbo, I actually checked the "ask a question" function. Fact is, it also messes up the product detail page
by e.g. changing typeface and the selection of a new variant won't work anymore. VM simply hangs.

All works fine, until I open "ask a question".