如果用户已使用该ID订阅,则在来宾订阅者中显示错误消息

时间:2013-06-25 04:41:53

标签: magento magento-1.7

我正在使用magento默认通讯订阅者。我发现仅当订户在magento商店中有帐户时才会显示错误There was a problem with the subscription: This email address is already assigned to another user.。如果订户是访客客户,则不会显示错误,将显示成功消息,说明已订阅时事通讯。如何在访客用户中显示消息。

1 个答案:

答案 0 :(得分:1)

您应该编辑以下文件:

/app/code/core/Mage/Newsletter/controllers/SubscriberController.php

在这行代码上方的第63行

$status = Mage::getModel('newsletter/subscriber')->subscribe($email);

添加以下代码:

$emailExist = Mage::getModel('newsletter/subscriber')->load($email, 'subscriber_email');
if ($emailExist->getId()) {
Mage::throwException($this->__('This email address is already exist.'));
}