新闻订阅不在Magento工作

时间:2014-07-23 07:50:22

标签: javascript jquery ajax magento

/app/design/frontend/default/css2406/template/newsletter/subscribe.phtml

<form action="<?php echo $this->getUrl('checkout/cart/subscribenews') ?>" method="post" id="newsletter-validate-detail">
    <div class="form-subscribe">
        <div class="input-box">
            <input type="text" name="email" id="newsletter" placeholder="Enter your email address" title="<?php echo $this->__('Sign up for our newsletter') ?>" class="input-text required-entry validate-email" />
        </div>
        <button type="button" onclick="newsletterSubscriberFormDetail.submit('<?php echo $this->getUrl('checkout/cart/subscribenews') ?>')" title="<?php echo $this->__('Submit') ?>" class="button">
            <span>
                <span><?php echo $this->__('Go') ?></span>
            </span>
        </button>
    </div>
</form>

<script type="text/javascript">


     //<![CDATA[

    var newsletterSubscriberFormDetail = new VarienForm('newsletter-validate-detail');

     /*new Varien.searchForm('newsletter-validate-detail', 'newsletter', '<?php echo $this->helper('newsletter')->__('Enter your email address')  ?>');*/

        newsletterSubscriberFormDetail.submit = function(button, url) {

        if (this.validator.validate()) {

                 submitNewsletter();

            }else{



                }

    }.bind(newsletterSubscriberFormDetail);



    function submitNewsletter(){


        $( document ).on( 'keydown', function ( e ) {
            if ( e.keyCode === 27 ) { // ESC
                Effect.Fade('newsletter_msg_close', { duration: 0.2, delay: 0.2 });
                Effect.Fade('newsletter_msg', { duration: 0.4, delay: 0.2 });
            }
        });


        Event.observe('newsletter_msg_close', 'click', function() {
           Effect.Fade('newsletter_msg', { duration: 0.4, });
            Effect.Fade('newsletter_msg_close', { duration: 0.2 });
        });

               jQuery.ajax({

            url:"<?php echo $this->getUrl('checkout/cart/subscribenews') ?>",   

            type:'POST',

            data:jQuery('#newsletter-validate-detail').serialize(),



            success:function(data){

                var contact = JSON.parse(data);

                if(contact['success']){
                    jQuery(".msgcontent").html('<span class="news">'+contact['success']+'</span>');
                }

                 if(contact['error']){
                    jQuery(".msgcontent").html('<span class="news">'+contact['error']+'</span>');
                }

                    Effect.Appear('newsletter_msg', { duration: 0.4, delay: 0.2 });
                    Effect.Appear('newsletter_msg_close', { duration: 0.2, delay: 0.4 });

                    Effect.Fade('newsletter_msg_close', { duration: 0.2, delay: 8 });
                    Effect.Fade('newsletter_msg', { duration: 0.4, delay: 8 });

            }

        });

    }

    //]]>

</script>

这是新闻订阅表单的代码,我正在尝试提交电子邮件ID并输入提交它没有收到任何邮件,我没有收到任何失败或成功的通知

标题中的

我有

<div id="newsletter_msg" class="msgcontainer"  style="display:none;"><div class="msg"><div class="Table-Cell"><div class="msgcontent"></div><a href="javascript:void(0)" id="newsletter_msg_close"  style="display:none;" title="Close message">&times;</a></div></div></div>

显示淡入淡出框,但我没有收到任何消息。

0 个答案:

没有答案