Reply to comment

Thanks for this article. I used it to add some more checkboxes to customer preferences.
At first it wasn't saving anything and I had to modify the controller (newsletter/controllers/ManageController.php) to save the values. Somewhere I read that you don't have to do this, but I found that I did. It was quite simple in my case, just find the action which is saving, in my case saveAction and set the extra fields.

Mage::getSingleton('customer/session')->getCustomer()
->setStoreId(Mage::app()->getStore()->getId())
->setIsSubscribed((boolean)$this->getRequest()->getParam('is_subscribed', false))
->setNewfield((boolean)$this->getRequest()->getParam('newfield', false))
->save();

Of course you have to point the form action to the new controller too ;)

Reply

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <apache>, <bash>, <c>, <cpp>, <drupal5>, <drupal6>, <java>, <javascript>, <perl>, <php>, <python>, <ruby>, <xml>. The supported tag styles are: <foo>, [foo].

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.