【问题标题】:Force newsletter subscription in Magento在 Magento 中强制订阅时事通讯
【发布时间】:2010-08-10 10:19:05
【问题描述】:

我正在与 Magento 合作,其中我需要要求,如果任何客户注册,他/她必须自动订阅新闻通讯。

例如,在管理站点中,如果我们编辑客户,我们会看到“订阅时事通讯?”的时事通讯复选框。我希望始终选中该复选框。

请帮帮我。

【问题讨论】:

    标签: magento


    【解决方案1】:

    一件小事:检查这在您部署的地区是否合法。

    例如,一些立法坚持营销电子邮件必须默认为“选择加入”而不是“选择退出”——这可能是 Magento 保持默认设置的原因。

    不要试图“诱骗”用户意外订阅内容也是公认的最佳做法。最好将选项保留为“关闭”并使用其他方式显示消息以鼓励用户订阅。

    【讨论】:

      【解决方案2】:

      最简单的方法是修改模板并将复选框替换为始终设置为 1 的隐藏输入。您需要编辑文件 /app/design/frontend/your_interface/your_theme/template/customer /form/register.phtml.

      删除这段代码:

          <li>
              <input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed" <?php if($this->getFormData()->getIsSubscribed()){ ?> checked="checked"<?php }elseif($this->getFormData()->getIsSubscribed == NULL){ ?> checked="checked"<?php }?> />
              <label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
          </li>
      

      然后在表单顶部附近的其他输入之后添加您的隐藏输入:

      <input type="hidden" name="success_url" value="<?php echo $this->getSuccessUrl() ?>" />
      <input type="hidden" name="error_url" value="<?php echo $this->getErrorUrl() ?>" />
      <input type="hidden" name="is_subscribed" value="1" id="is_subscribed"  />
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-11-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2015-12-13
        • 1970-01-01
        • 1970-01-01
        • 2017-02-09
        相关资源
        最近更新 更多