Categories

Featured templates

Magento. How to make newsletter subscription option checked by default

Ray Taylor December 14, 2015
Rating: 5.0. From 3 votes.
Please wait...

This tutorial will show you how to make newsletter subscription option auto checked on Magento registration Page.

Magento. How to make newsletter subscription option checked by default

Using the file manager such as FileZilla, Total Commander, etc., connect to your server where you’ve installed your Magento store:

  1. Navigate to /app/design/frontend/tm_themes/themeXXX/template/persistent/customer/form directory.

  2. Open register.phtml file.

  3. Find this line:

    <?php if ($this->isNewsletterEnabled()): ?>

    Right below it, add this code:

    		<?php
    		$checked = true;
    		if($this->getFormData()->getEmail()) {
    		if(!$this->getFormData()->getIsSubscribed()) {
    		$checked = true;
    		}
    		} 
    		?>
    	

    magento_newsletter_auto-checked_on_registration_page1

  4. Look for the following div:

    <div class="input-box">
  5. Replace:

    <?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?>

    With :

    checked="checked"

    magento_newsletter_auto-checked_on_registration_page2

  6. Save this file and upload to the server, replacing the original file. Reload your site to see the changes.

  7. Now we have the "Sign Up for Newsletter" box checked by default:

    magento_newsletter_auto-checked_on_registration_page3

Thank you for reading this tutorial. Good luck!

Feel free to check the detailed video tutorial below:

Magento. How to make newsletter subscription option checked by default

Templates for Magento
This entry was posted in Magento Tutorials and tagged checked, default, Magento, newsletter, option. Bookmark the permalink.

Submit a ticket

If you are still unable to find a sufficient tutorial regarding your issue please use the following link to submit a request to our technical support team. We'll provide you with our help and assistance within next 24 hours: Submit a ticket

Live Chat
We help you to choose the right product.