- Web templates
- E-commerce Templates
- CMS & Blog Templates
- Facebook Templates
- Website Builders
Magento. How to make newsletter subscription option checked by default
December 14, 2015
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:
-
Navigate to /app/design/frontend/tm_themes/themeXXX/template/persistent/customer/form directory.
-
Open register.phtml file.
-
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; } } ?>
-
Look for the following div:
<div class="input-box">
-
Replace:
<?php if($this->getFormData()->getIsSubscribed()): ?> checked="checked"<?php endif; ?>
With :
checked="checked"
-
Save this file and upload to the server, replacing the original file. Reload your site to see the changes.
-
Now we have the "Sign Up for Newsletter" box checked by default:
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