按顺序添加时事通讯订阅检查选项感谢页面 Magento

Add newsletter subscribe check option in order Thank you page Magento

我想为客户添加选项,以便可以在结帐感谢页面中订阅时事通讯。

如何删除“提交”按钮,让那里只有一个复选框?

谢谢

现在在我的成功页面中添加以下代码:

   <div class="order-newsletter">
        <?php echo $this->getLayout()->createBlock('newsletter/subscribe')->setTemplate('newsletter/subscribe.phtml')->toHtml(); ?>
    </div>

更新:

我找到了这段代码,但在结账成功页面出现了这个错误:

致命错误:在 non-object

上调用成员函数 getEmail()
<?php
$checked = true;
if($this->getFormData()->getEmail()) {
    if(!$this->getFormData()->getIsSubscribed()) {
        $checked = false;
    }
}   
 ?>
<li class="control">
<div class="input-box">
    <input type="checkbox" name="is_subscribed" title="<?php echo $this->__('Sign Up for Newsletter') ?>" value="1" id="is_subscribed"<?php if($checked): ?> checked="checked"<?php endif; ?> class="checkbox" />
</div>
<label for="is_subscribed"><?php echo $this->__('Sign Up for Newsletter') ?></label>
<?php /* Extensions placeholder */ ?>
<?php echo $this->getChildHtml('customer.form.register.newsletter')?>
</li>

试试这个 https://magento.stackexchange.com/a/52285/14174

您需要为时事通讯添加添加框,然后挂钩观察者以将客户添加到订阅列表中。