Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/404.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript Magento Fancybox表单-重定向到产品页面_Javascript_Php_Jquery_Magento_Fancybox - Fatal编程技术网

Javascript Magento Fancybox表单-重定向到产品页面

Javascript Magento Fancybox表单-重定向到产品页面,javascript,php,jquery,magento,fancybox,Javascript,Php,Jquery,Magento,Fancybox,我有以下问题。在我的Magento商店中,我更改了产品页面中的“发送电子邮件给朋友”功能,以便在单击链接时,表单会显示在lightbox iframe中。表单工作正常,电子邮件已发送 但是,页面会在弹出窗口中重新加载,并在弹出窗口中显示成功消息。我需要弹出窗口关闭后,发送按钮被单击,以便产品页面将重新加载并显示成功消息 这是我在产品页面(template/catalog/product/view/addto.phmtl)中用于电子邮件到朋友链接的代码: jQuery(文档).ready(函数(

我有以下问题。在我的Magento商店中,我更改了产品页面中的“发送电子邮件给朋友”功能,以便在单击链接时,表单会显示在lightbox iframe中。表单工作正常,电子邮件已发送

但是,页面会在弹出窗口中重新加载,并在弹出窗口中显示成功消息。我需要弹出窗口关闭后,发送按钮被单击,以便产品页面将重新加载并显示成功消息

这是我在产品页面(template/catalog/product/view/addto.phmtl)中用于电子邮件到朋友链接的代码:


jQuery(文档).ready(函数(){
jQuery(“a[rel=fancybox1]”
'type':'iframe',
“宽度”:700,//更改所需的宽度
“高度”:700//更改所需高度
});
});
这是表单(template/sendfriend/Send.phtml)中发送按钮的代码:


是否存在任何JavaScript问题??不,没有JavaScript冲突。
我需要在单击发送按钮后关闭弹出窗口
:将
单击
事件绑定到调用
父项的按钮。$.fancybox.close()
API方法。
<script type="text/javascript">
jQuery(document).ready(function(){      
jQuery("a[rel=fancybox1]").fancybox({            
'type'    : 'iframe',
'width'    : 700, // change the required width
'height'   : 700 // change the required height
 });
 });
</script>

<a href="<?php echo $this->helper('catalog/product')->getEmailToFriendUrl($_product) ?>" rel="fancybox1"><?php echo $this->__('Recommend to a friend') ?></a>
<button type="submit" class="button<?php if (!$this->canSend()):?> disabled<?php endif ?>"<?php if (!$this->canSend()):?> disabled="disabled"<?php endif ?>><span><span><?php echo $this->__('Send Email') ?></span></span></button>

<script type="text/javascript">
//<![CDATA[
    var productSendtofriendForm = new VarienForm('product_sendtofriend_form');
    productSendtofriendForm.submit = function() {
        if(this.validator.validate()) {
            this.form.submit();
        }
    }.bind(productSendtofriendForm);
//]]>
</script>