24
May
Got this nice extension which puts a ‘Newsletter Sign-up’ check-box on the Magento checkout page.
http://www.magentocommerce.com/magento-connect/QuickModules/extension/1361/checkout-newsletter/
Due to permission restrictions I was not able to connect to the Magento Connect Manager link on my live cart. So I went ahead and installed it on my localhost Magento. Here are the steps:
1. Login into Admin > Magento Connect > Magento Connect Manager
2. Re-entered the admin username/password
3. Enter the extension key I got from the URL above
4. Click “Install”
Configure the module
This is a simple (and extremely useful) module with not much configuration needed.
To enable and configure the module I went to Admin > System > Configuration > Customer > Newsletter
Here I saw a new section ‘Checkout Newsletter’. This is my settings:
Enable => yes
Checked by default => yes
Visible to guest => yes
Visible to registrant => yes
Now when you checkout you will see a check-box to sign-up for newsletter.
How to shift this module to your live cart?
Since, I couldn’t use the Magento Connect Manager on my live cart I FTP-ed these files:
(The name of the module is checkoutnewsletter and the company that created it is Desitex)
1. Copy the file Desitex_Checkoutnewsletter.xml from the app/etc/modules folder
2. Copy the folder Desitex from app/code/community folder
3. Copy the folder checkoutnewsletter from the app/design/frontend/default/default/template folder
4. Copy the file checkoutnewsletter.xml from the app/design/frontend/default/default/layout folder
5. Login into the admin area and clear the cache.
To configure the module, follow the same steps as for the localhost cart.
Thats it!
[Edit]
Thanks to Brady, I took a closer look at the module. The module will break for Magento ver 1.4 beta1 and above – here is the fix:
Open the file:
[magento-root]/app/code/community/Desitex/Checkoutnewsletter/Model/Observer.php
On line number 10 change:
case Mage_Sales_Model_Quote::CHECKOUT_METHOD_REGISTER:
to
case ‘register’:
On line number 14 change:
case Mage_Sales_Model_Quote::CHECKOUT_METHOD_GUEST:
to
case ‘guest’:
The use of these 2 constants became deprecated since Magento 1.4 beta1





I’ve tried this extension in the past, but uninstalled it because there is a bug that will not let users uncheck the Newsletter Registration box. We used it for 2 days and had numerous customers complain that they felt forced to register for the newsletter.
Have you had any experience with this issue?
Oh! I didn’t notice this – you are correct – it doesn’t let users to uncheck. Thanks for bringing this to my notice. As a token of gratitude here is the fix for it
Open this file
[magento-root]/app/design/frontend/default/default/template/checkoutnewsletter/newsletter.phtml
And change the Javascript to this:
//<![CDATA[
var firstTimeDone = false;
Element.show('register-customer-newsletter');
hideCheckoutNewsletter = function (){
if (typeof(checkout) != 'undefined'){
if (checkout.method == 'register'){
isVisibleRegister()): ?>
Element.hide('register-customer-newsletter');
$('billing:is_subscribed').checked = false;
Element.show('register-customer-newsletter');
isChecked() || $helper->isChecked()): ?>
if (firstTimeDone == false) {
$('billing:is_subscribed').checked = true;
firstTimeDone = true;
}
}
else if (checkout.method == 'guest'){
isVisibleGuest()): ?>
Element.hide('register-customer-newsletter');
$('billing:is_subscribed').checked = false;
Element.show('register-customer-newsletter');
isChecked() || $helper->isChecked()): ?>
if (firstTimeDone == false) {
$('billing:is_subscribed').checked = true;
firstTimeDone = true;
}
}
}
}
setInterval("hideCheckoutNewsletter()", 100);
//]]>
Funny, that none of our customer’s have reported this issue.
Hope this fix works for you – do let me know.
I’ve tried this extension and updated the JS with yours (thanks!). The problem is it still doesn’t seem to work 100% and only adds registered users emails. Guests just seem to get ignored.
Has everyone else found this?
Hi
I tried this extension a while back, but uninstalled it because even though i got it working in the frontend it never showed any results in the backend. So the checkbox was check but no new entry in Newsletter -> Newsletter Subscriber was added.
Now that i came across your article here i hope that you might have an answer since the developer of the extension could not give me any support anymore since he gave it to a company that charges now for that “new” extension. And even though i bought it and installed it – i had to uninstall it again since it broke another extension i am using.
So if you can help me out here – i would be more then thrilled.
Cheers Gunnar
Hi Alan
With me it does not even insert registered users in the Newsletter Subscriber page.
I wish i knew what is wrong.
Cheers Gunnar
Hi gayatri.sa
Do you happen to have any insights on this subject.
I really could use some help here.
Thanks.
Gunnar
Thank you for your bugfix. For me only guests can subscribe to the newsletter.
Users, who register through the checkout process, are not subscribed.
Maybe someone knews the solution?
Thanks
Alex
I concur: still not working after making those constant changes in Observer.php. (customers aren’t added to the newsletter_subscriber table. I believe the core issue is that Magento 1.4 changed the way it handles newsletter subscriptions in addition to Brady’s suggestions above.
We’re also discussing this on the Magento forum here:
http://www.magentocommerce.com/boards/viewthread/193167/
Any more thoughts?
Over on the other thread, we’ve taken your advice & added to it. Seems to work now, although we’re still testing & not 100% sure. Add in one more line like this: case ‘login_in’:
switch ($quote->getCheckoutMethod()){
case ‘register’:
case ‘login_in’:
$customer->setIsSubscribed(1);
break;
case ‘guest’:
Thanks for a good blog.
Is their anyone who knows if there is a extensions which works with 1.4.0.1?
Thanks for a your help!
Thanks for this. But my dreamweaver finds an error in javascript on line 17 which is: “isVisibleRegister()): ?>”. Is there anything wrong there?
guys I’m Brazilian. sorry for bad english (by Google Translator). I found a simple way to include registration of newssletter at the checkout page.
follow the steps:
1 – Open: design/frontend/default/default/checkout/onepage/billing.phtlm
2 – Paste code: <input type="checkbox" name="billing[is_subscribed]" title="__(‘Sign Up for Newsletter’) ?>” value=”1″ id=”billing:is_subscribed” class=”checkbox” />
3 – Open: app/code/core/Checkout/Model/Type/Onepage.php
4 – Paste code: dentro do método savebilling. na linha 289. cole o codigo: if (isset($data['is_subscribed'])) {
$status = Mage::getModel(‘newsletter/subscriber’)->subscribe($data['email']);
}
5 – This is it
Rodrigo – thanks for the code- worked great for us. We were having problems with the checkoutnewsletter extension breaking our gift registry checkouts. Your fix did the trick for us.
Thank Rodrigo. That worked really well!
Although there are a few errors…
The code on stage 2 should be:
<input type="checkbox" name="billing[is_subscribed]" title="” value=”1″ id=”billing:is_subscribed” class=”checkbox” />
and Stage 3 should be: app/code/core/Mage/Checkout/Model/Type/Onepage.php
and you should copy that to:
app/code/local/Mage/Checkout/Model/Type/Onepage.php