I have a custom module, which uses the sales_order_place_before observer. I have a set of code in there which scans through the products, and adds items to the order, where necessary. However, I have found that this is running twice, so wherever it adds an item to the order, it does so twice.
I can't work out why it is running twice, so I was going to use a Magento registry value, set to false, and when it has ran once, change it to true, and wrap an if statement around my code, which check that value. In the custom module, I only have the config.xml file and the Observer.php. Where do I put the
Mage::registry('check_sales_order_before', false);
code? I don't think I can put it in the observer, or it will just reset every time, and cause the exact same issue. I'm assuming I add another file somewhere in my module, or place it in a central file somewhere.
Any ideas?
Thank you.