2016-05-31 47 views
0

我想添加选项的客户可以订阅通讯在结帐谢谢页面。添加新闻通讯订阅检查选项的顺序谢谢页Magento

我如何删除提交按钮,并只有一个复选框?

眼下谢谢

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

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

enter image description here

更新:

我发现这个代码,但在结账成功页面我有这个错误:

致命错误:调用非对象的成员函数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> 

回答

相关问题