Magento add newsletter subscribe in checkout

Magento add newsletter subscribe in checkout

July 24, 2026 · Illustrated author avatarBy Stefan Bogdanescu
Magento add newsletter subscribe in checkout

Adding Newsletter Signup to Magento Checkout

As a Magento developer, I frequently encounter requests from clients who want to enable newsletter signup during the checkout process, especially for new customers creating an account. This feature can help you build your email marketing list and keep customers engaged with your brand.

The Current Approach and Its Limitations

In your case, you’ve already attempted to add a checkbox in the billing.phtml file to allow customers to sign up for the newsletter during checkout. While this is a good start, there are a few reasons why it might not be working as expected:

  1. Checkbox Name: The name attribute of the checkbox (name="is_subscribed") should match the expectation in your Magento configuration.
  2. Form Validation: Magento requires form validation for new account creation. Adding the newsletter subscription to this process is necessary for the data to be saved correctly.

Steps to Implement Newsletter Signup During Checkout

To solve this issue, you’ll need to update the billing.phtml file and make some changes in your Magento configuration. Here’s a step-by-step guide:

1. Update the billing.phtml File

In your app/design/frontend/<your_package>/<your_theme>/template/checkout/billing.phtml file, you should have a section for creating an account during checkout. Find this section and update it as follows:

<div id="is_subscribed">
    <input type="checkbox"
           name="newsletter_signup"
           title="<?php echo $this->__('Sign Up for Newsletter') ?>"
           value="1" class="checkbox" />
    <?php echo $this->__('Sign Up for our Newsletter 2') ?>
</div>

2. Update the Checkout Configuration

Next, you need to update your Magento checkout configuration to accept the newsletter signup data along with the new account creation.

Locate the app/code/core/Mage/Checkout/etc/config.xml file and search for the <checkout_agreements> section. It should look something like this:

<checkout_agreements>
    <form_fields>
        <agreement>
            <name>newsletter_signup</name>
            <type>checkbox</type>
            <sort_order>10</sort_order>
            <required>0</required>
        </agreement>
    </form_fields>
</checkout_agreements>

Ensure that the name attribute matches your checkbox name (newsletter_signup) and the sort_order is set to a value that suits your layout preferences.

3. Update the Checkout Form Data

The final step involves updating how Magento processes the newsletter signup data during checkout.

In the app/code/core/Mage/Checkout/controllers/OnepageController.php file, you need to modify the _saveOrderData() method:

public function _saveOrderData($data)
{
    // ... (existing code)

    if (!empty($data['newsletter_signup'])) {
        Mage::getSingleton('customer/session')->setNewsletter(1);
    } else {
        Mage::getSingleton('customer/session')->setNewsletter(0);
    }

    // ... (remaining code)
}

This modification ensures that the newsletter signup data is correctly saved and linked to the customer session.

Conclusion

Adding a newsletter subscription option during the Magento checkout process requires careful integration with your existing account creation workflow. By following these steps, you can successfully allow new customers to sign up for your newsletter while completing their purchase.

Remember, keeping your Magento installation up-to-date with the latest security patches is crucial for protecting customer data and maintaining a positive brand image.

For more advanced customizations like this one, I recommend working with experienced Magento developers or consulting services. At Laravel Company, we specialize in providing high-quality e-commerce solutions tailored to your business needs.

Don’t hesitate to reach out if you require further assistance or want to discuss how a well-optimized checkout process can improve your conversion rates and customer satisfaction.

Checkout Themes Configuration Email

Our network