Updating a customer-related SESSION variable on pageload with an observer
When I update a custom field in the customer record, I want that to take effect on the next page load.
Initially I am using the notifier-observer in function zen_is_logged_in to get the custom field, as it is only used when the customer is logged in, but I see that function gets called multiple times on a page load so it's wasteful.
Suggestions for a better notifier/way to do this, that gets called once?
Re: Updating a customer-related SESSION variable on pageload with an observer
On the store front there is the 'NOTIFY_FOOTER_END' notifier in the respective includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php
Code:
$zco_notifier->notify('NOTIFY_FOOTER_END', $current_page);
That is expected to be loaded once per page load, though also depends on the page actually loading to that point (e.g. a page error before that point will prevent execution).
Alternatively some file that gets loaded on each page load... There are plenty of places to tuck that away.
Re: Updating a customer-related SESSION variable on pageload with an observer
That worked for me, thanks.