I am trying to add a new field (subscriber_type) to the newsletter subscribe form. I have setup my observer and it is working and firing correctly (newsletter_subscriber_save_before):
<?php
class Mynamespace_Enhancednewsletter_Model_Observer {
public function saveBefore($observer){
$subscriber = $observer->getEvent()->getSubscriber();
$type = Mage::app()->getRequest()->getParam('type'); // this contains my new data correctly
$subscriber->setSubscriberType($type);
return $this;
}
}
I have also added the field to the db. The above code adds the new subscriber but doesn't add the subscriber_type.
Can anyone see where I'm going wrong?
Thanks
Man this one was frustrating..but the answer was so simple:
Magento caches table descriptions so make sure you clear your cache after adding a new field to the db.
Thanks to MJA for the answer: https://stackoverflow.com/a/10550476/491055