I've searched and searched how to add the 'sign up for newsletter' checkbox (same as on the customer/account/create/ page), to the /checkout/onepage page, but can't find any definitive answer.

I'd like it at the 'billing information' stage if possible.

1 Answer 1


This is possible with a small extension ... here the most important steps:

  • create your own extension

  • app/code/community/[Vendor]/[Module]/etc/config.xml

     <?xml version="1.0"?>
  • app/code/community/[Vendor]/[Module]/Model/Observer.php

     class [Vendor]_[Module]_Model_Observer
         public function subscribeEventSaveBilling(Varien_Event_Observer $observer)
             $billing = $observer->getEvent()
                 ->getParam('billing', array());
             $willSubscribe = isset($billing['subscribe']);
             return $this;
         public function subscribeEventOnepageSaveOrderAfter(Varien_Event_Observer $observer)
             $willSubscribe = Mage::getSingleton('checkout/session')->getWillSubscribe();
             if ((bool)$willSubscribe) {
                 $email = $observer->getEvent()->getOrder()->getData('customer_email');
                 Mage::getModel('newsletter/subscriber')->subscribe($email, true);
             return $this;
  • app/code/community/[Vendor]/[Module]/Helper/Data.php

     class [Vendor]_[Module]_Helper_Data extends Mage_Core_Helper_Abstract
         /** @var string $_moduleName Module name */
         protected $_moduleName = '[Vendor]_[Module]';
         public function isSubscribed()
             $customer = Mage::getSingleton('customer/session')->getCustomer();
             if ($customer) {
                 $customerEmail = $customer->getEmail();
                 $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($customerEmail);
                 if ($subscriber) {
                     return $subscriber->isSubscribed();
  • app/design/frontend/base/default/layout/[Vendor]/[Module].xml

     <layout version="0.1.0">
             <reference name="checkout.onepage.billing">
                 <block type="core/template" name="form.additional.info">
                     <action method="setTemplate">
  • app/design/frontend/base/default/template/[Vendor]/[Module]/subscribe.phtml

     $helper = Mage::helper('newslettersubscribe');
     <li class="control">
         <input type="checkbox" name="billing[subscribe]" id="billing:subscribe" value="1" <?php if ($helper->isSubscribed()): ?> checked="checked"<?php endif; ?> class="checkbox" />
         <label for="billing:subscribe"><?php echo $helper->getFrontendLabel() ?></label>

If I havn't missed anything this should a checkbox to your checkout billing section. If you want the checkbox at review step, read here Newsletter subscription at the checkout review.

  • Thank you sv3n - I will be working on this tomorrow and will report back.
    – Andy
    Commented Mar 22, 2018 at 16:02
  • Hi sv3n With little knowledge of how to create extensions, I think I need step by step instructions. I'm confused at step 1 :-) I did manage to create the file and folder structure for the module and get it to display in the Admin/Advanced/Advanced Disable Modules Output list, but as to where the code above goes, I'm lost.
    – Andy
    Commented Mar 26, 2018 at 12:04
  • @Andy updated answer. Hope this helps a bit.
    – sv3n
    Commented Mar 27, 2018 at 22:13
  • Hi sv3n - again thank you! I created my extension (AJH_NewsSub) and can see it active in Admin. I replaced all [Vendor]/[Module] with AJH/NewsSub logic and created the following: app/code/community/AJH/NewsSub/etc/config.xml app/code/community/AJH/NewsSub/etc/Model/Observer.php app/code/community/AJH/NewsSub/etc/Helper/Data.php app/design/frontend/base/default/layout/AJH/NewsSub.xml app/design/frontend/base/default/template/AJH/NewsSub/subscribe.phtml This didn't display the subscribe checkbox. I am using a custom theme and will give detail in my next reply.
    – Andy
    Commented Mar 28, 2018 at 11:57
  • My custom theme uses the following to display the billing section of my checkout: frontend\argento\default\template\persistent/checkout/onepage/billing.phtml I've tried several places for the NewsSub.xml and subscribe.phtml files but no luck so far. This is helping me to understand the structure of Magento better and i'd love to get this working if possible.
    – Andy
    Commented Mar 28, 2018 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.