javascript - Magento Fancybox form - redirect to product page -


i have following issue. in magento store have changed "email friend" functionality in product page when link clicked form appears in lightbox iframe. form works fine , email sent.

however, page reloaded in popup , success message displayed there. need pop-up window close after send button clicked, product page reload , display success message.

this code i'm using email friend link in product page (template/catalog/product/view/addto.phmtl):

<script type="text/javascript"> jquery(document).ready(function(){       jquery("a[rel=fancybox1]").fancybox({             'type'    : 'iframe', 'width'    : 700, // change required width 'height'   : 700 // change required height  });  }); </script>  <a href="<?php echo $this->helper('catalog/product')->getemailtofriendurl($_product) ?>" rel="fancybox1"><?php echo $this->__('recommend friend') ?></a> 

this code send button in form (template/sendfriend/send.phtml):

<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> 

any on appreciated.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -