7. Magento. How to make newsletter subscription option checked by default
1 min readUsing 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:
1<?php if ($this->isNewsletterEnabled()): ?>
Right below it, add this code:
123456789<?php$checked = true;if($this->getFormData()->getEmail()) {if(!$this->getFormData()->getIsSubscribed()) {$checked = true;}}?> - Look for the following div:
1<div class=”input-box”>
- Replace:
1<?php if($this->getFormData()->getIsSubscribed()): ?> checked=”checked”<?php endif; ?>
With :
1checked=”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!