[英]Magento newsletter succeess message in pop up
我想在提交简报表后创建成功消息的精美弹出窗口。 我如何用jquery js做到这一点? 如果我一开始思考我需要检查消息,如果message = newsletter成功消息,则在弹出窗口中显示此消息。 对? 但是我怎么能意识到这一点呢? =)谢谢!
我找到了三种方法,并将其应用到我的Magento中:
方法1:
添加到页面顶部,您要显示以下js脚本的成功消息:
<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页面,即简报促销
打开SubscriberController.php文件位于:
MagentoStore \\软件\\代码\\核心\\法师\\新闻\\控制器\\
更改
$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>.'));
同样也是这样做的好主意; 请输入有效的电子邮件地址; 确认请求已发送; 并且订阅,消息有问题。
方法3。
重定向到折扣产品的特殊页面,该页面仅由订阅者推送,其中包含新闻稿策略。
Magento Admin>Catalog>Manage Products>Add New Product
创建新的特殊折扣产品,Visibilty属性设置为,Nowhere。 记下产品ID。
Magento Admin>CMS>Manage Pages>Add New Page
创建简报政策CMS页面,即简报政策和促销。 在此页面中,您可以添加为新订阅者创建的特殊产品。 (这不包括在此范围内,如何)
大约65号线的变化:
$this->_redirectReferer();
至
$this->_redirectUrl(Mage::getBaseUrl().'newsletter-policy-and-promotions');
$this->_redirectUrl(Mage::getBaseUrl());
至
$this->_redirectUrl(Mage::getBaseUrl().'newsletter-policy-and-promotions');
现在,订户将自动重定向到您的新页面,并且仍将显示“感谢您订阅”消息。
希望这对你有所帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.