我试图在 subscribe.phtml
文件中显示时事通讯的成功消息,我认为这应该非常简单,但事实并非如此。
代码如下:
`<?php echo $this->getChildHtml('global_messages') ?>`
和:
<?php // Getting Messages from Session
$messages=$messages=Mage::getSingleton("core/session")->getMessages();
echo $this->getLayout()->createBlock("core/messages")->setMessages($messages)->getGroupedHtml();?>
似乎不起作用。对此有何建议?
干杯, 鸟类
最佳答案
看看/app/code/core/Mage/Newsletter/controllers/SubscriberController.php
有这样一行,它被执行:
else {
$session->addSuccess($this->__('Thank you for your subscription.'));
}
我的文件中的第 68 行。
也可以在 /app/locale/en_US/Mage_Newsletter.csv
文件以及您希望支持的任何其他语言中进行编辑。
更改“感谢您的订阅。”,“感谢您的订阅。”
到
"Thank you for your subscription.","This will be my new message, that I wish to display to users, after subscribing."
或到
"Thank you for your subscription.",""
此处不显示任何内容。
关于时事通讯中的 Magento 全局消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9017919/