I want to display "fancybox" popup with a custom form and a custom action in button click. I have refered the following link: Make a Popup window showup on clicking a html link.
But where can I add the custom form content to dispaly in popup?
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityI want to display "fancybox" popup with a custom form and a custom action in button click. I have refered the following link: Make a Popup window showup on clicking a html link.
But where can I add the custom form content to dispaly in popup?
1) Create your module form then put the template form in a some phtml something like: app/design/frontend/{package}/{theme}/template/form/new-form.phtml
.
2) Put this code in the <body>
of the fancybox <?php echo $this->getLayout()->createBlock('core/template')->setTemplate('form/new-form.phtml')->toHtml(); ?>
3) The fancybox you can display it where you want,
in app/design/frontend/{package}/{theme}/layout/local.xml
, you add this piece of code:
<your_layout_handle>
<reference name="root">
<block type="core/template" name="fancy.block" template="path_to_your_file.phtml"/>
</reference>
</your_layout_handle>
then add this one in the file where your to display it:
<?php echo $this->getBlockHtml('fancy.block'); ?>