Turiknox / magento-checkout-newsletter

A simple Magento module that will allow you to add a newsletter subscribe checkbox to the default onepage checkout billing step.
MIT License
1 stars 5 forks source link

Would it make sense to add a rd option here? #7

Open seansan opened 6 years ago

seansan commented 6 years ago

https://github.com/Turiknox/magento-checkout-newsletter/blob/master/app/code/community/Turiknox/CheckoutNewsletter/Model/Observer.php

this one

if (!$customerEmail) { $customer = Mage::getSingleton('customer/session')->getCustomer(); $customerEmail = $customer->getEmail(); }

here

$quote = Mage::getSingleton('checkout/session')->getQuote();
$customerEmail = $quote->getCustomerEmail();
if (!$customerEmail) {
    $customerEmail = $quote->getBillingAddress()->getEmail();
}
if (!$customerEmail) {
    $customerEmail = $quote->getBillingAddress()->getEmail();
}
if (!$customerEmail) {
    $customer = Mage::getSingleton('customer/session')->getCustomer();
    $customerEmail = $customer->getEmail();
}