I have used Mage::getSingleton to share data across and within Modules before, but I'm coming across a problem where its not working in this specific scenario.
My module asks questions at checkout that ultimately effect the shipping rate of separate shipping module. The options are saved via AJAX into Mage::getSingleton('checkout/session')->setOptions($data);
and then loaded from that within the shipping extension module.
In the normal checkout process everything works correctly. However, I have been working to add this into the Admin section for creating orders in the back end. I can set and get into Mage::getSingleton('checkout/session')
from within my Options module, but when I try Mage::getSingleton('checkout/session')
in the shipping module, it returns the object but without my setOptions
array.
I can reload the admin area and do Mage::getSingleton('checkout/session')->getOptions()
which will return the correct data, so I know it is being saved correctly in the session. I have also tried using Mage::getSingleton('adminhtml/session_quote')
but with no change in results.
Any idea why, when loaded in the adminhtml area, the shipping module would not be (correctly) reading Magento Singletons?