Magento通讯成功消息弹出 [英] Magento newsletter succeess message in pop up

查看:149
本文介绍了Magento通讯成功消息弹出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在提交新闻稿表格后为成功消息创建一个精美的弹出窗口.我如何使用jquery js做到这一点?如果起初我想的正确,我需要检查消息,如果message = newsletter成功消息,则不能在弹出窗口中显示这个mes.正确的?但是我怎么能意识到这一点呢? =)谢谢!

I want to create fine pop up window for success message after submitting newsletter form . How I can do this with jquery js ? if I thinking right at first I need to check messages and if message = newsletter success message than show this mes in popup . right? but how can I realize this ? =) Thanks!

推荐答案

我发现了三种方法,并将其应用到了我的Magento中:

I have found three Method and I have applied it into my Magento:

方法1:
将以下js脚本添加到要显示成功消息的页面顶部:

Method 1:
Add to the top of the page you want to display the success message the following js script:

<script type="text/javascript">
var message = '<?php echo strip_tags($this->getChildHtml('global_messages')) ?>';
if (message == $this->__('Thank you for your subscription')) alert("What ever you want to display!");

方法2:
简单的注释,谢谢您的订阅.
登录到Magento管理员> CMS>管理页面>添加新页面
创建新闻稿政策CMS页面,即newsletter-promotions
打开位于以下位置的SubscriberController.php文件:

Method 2:
A simple note saying, Thank you for your subscription.
Log into Magento Admin>CMS>Manage Pages>Add New Page
Create a Newsletter Policy CMS page, i.e. newsletter-promotions
Open SubscriberController.php file located in:

MagentoStore \ App \ Code \ Core \ Mage \ Newsletter \ controllers \

MagentoStore\App\Code\Core\Mage\Newsletter\controllers\

更改

$session->addSuccess($this->__('Thank you for your subscription'));

$session->addSuccess($this->__('Thank you for your subscription. For more info on our Newsletter Policy, please click <a href="newsletter-promotions" target="_self">here</a>.'));

也要这样做也是一个好主意;请输入有效的电子邮件地址;确认请求已发送;并且订阅消息出现问题.

It would be a good idea to also do the same for; Please enter a valid email address; Confirmation request has been sent; and There was a problem with the subscription, messages.

方法3.
重定向到只有订阅者才能查看的特价商品特殊页面,其中包含新闻通讯政策.

Method 3.
Redirect to a special page of discounted products vieable only by subscribers, which contains the newsletter policy.

Magento Admin>Catalog>Manage Products>Add New Product

创建新的特殊打折产品,将可见性"属性设置为无处".记下产品ID.

Create new special discounted products, with Visibilty attribute set to, Nowhere. Make a note of the product ID.

Magento Admin>CMS>Manage Pages>Add New Page

创建新闻通讯策略CMS页面,即新闻通讯策略和促销.在此页面中,您可以添加为新订户创建的特殊产品. (这不在本指南的范围之内).
在大约65行更改:

Create a Newsletter Policy CMS page, i.e. newsletter-policy-and-promotions. In this page you can add your special products you created for your new subscribers. (This is not covered in the scope of this, How To)
Change at approx line 65:

$this->_redirectReferer();

$this->_redirectUrl(Mage::getBaseUrl().'newsletter-policy-and-promotions');
$this->_redirectUrl(Mage::getBaseUrl());

$this->_redirectUrl(Mage::getBaseUrl().'newsletter-policy-and-promotions');

现在,订阅者将自动重定向到您的新页面,并且仍然会显示谢谢您的订阅"消息.
希望对您有帮助.

Now the subscriber will automatically be redirected to your new page, and the, "Thank you for your subscription" message will still be displayed.
Hope this helps you.

这篇关于Magento通讯成功消息弹出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆