user1738628
user1738628

Reputation: 51

How to display popup in Magento

I am developing an extension for Magento and am trying to display a popup window to the user during checkout if their data is not able to be properly validated. I am trying to avoid making my own theme or modifying the default to trigger the window to pop up.

Is there another method that I can use to trigger this from the controller? Perhaps through getLayout I can inject the javascript to open the popup and then reload the page?

Upvotes: 0

Views: 999

Answers (1)

Odin
Odin

Reputation: 226

I would do something like this

<div style="display:none;">
<div id="mycontent">
// your content
</div>
</div>

<button type="button" id="linktopopup" href="#mycontent">

<script type="text/javascript">
("#linktopopup").fancybox({
autoDimensions: false,
afterShow: function(){
// append something to form!
}
});
</script>

Upvotes: 0

Related Questions