1

The problem I'm having is that when observing customer_save_after, I try and get the customer's newsletter subscription status, and it gets the value before the newsletter subscription status is saved.

Example: I click subscribe in the account dashboard and save, when I look at the logs, it says I am unsubscribed (from the last time I saved it), when I save it again, it will grab the previously saved status. Then I uncheck the box and click save, it will say I am subscribed as that was the last status before I unsubscribed.

I saw that Mage_Newsletter is also observing the same event. I set a depends in XML on Mage_Newsletter to ensure the configuration is loaded after that module, however this doesn't seem to fix the issue. I've refreshed my cache and even tried setting the depends to Mage_XmlConnect, as to ensure it is loaded much later in the xml stack. I'm all out of ideas here. Any help is greatly appreciated.

closed as off-topic by Fabian Schmengler, 7ochem, Amit Bera, Qaisar Satti, Matthéo Geoffray Jan 28 '16 at 12:16

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced OR seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Fabian Schmengler, 7ochem, Amit Bera, Qaisar Satti, Matthéo Geoffray
If this question can be reworded to fit the rules in the help center, please edit the question.

  • Local modules are always loaded after core modules, so you seem to have drawn the wrong conclusions. Without some code it's hard to say, where the mistake is. – Fabian Schmengler Jan 28 '16 at 11:49
1

Technically you should be able to set the depends on Mage_Newsletter and then your observer will happen after, either that or you could call your module X_X or something so it should be loaded last (note: the second idea is not the best solution).

You could also listen to the event newsletter_subscriber_save_after this will be fired after the subscriber action is saved.

  • Yea to call it X_X means refactoring a bit of code. I'll have to dump the xml stack and figure out what is happening. Either its a local issue or Mage is just being a punk. My module namespace starts with a V and the module P anyway so I dont think its an issue of naming convention. – DWils Mar 29 '14 at 21:42
  • I'll have to look at it monday, day off today, heh. – DWils Mar 29 '14 at 21:52

Not the answer you're looking for? Browse other questions tagged or ask your own question.