显示在来宾用户的错误信息,如果用户已经与该编号认购(Show error message in gu

2019-10-18 07:21发布

我使用的Magento默认的通讯用户。 我发现错误There was a problem with the subscription: This email address is already assigned to another user. 将示出仅当订户具有在Magento商店的帐户。 如果用户是来宾客户,然后错误将不会被显示,一个成功的味精会显示说明通讯已认购。 我怎样才能显示来宾用户还可以留言。

Answer 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.'));
}


文章来源: Show error message in guest subscriber if user already subscribe with that Id