Magento – checkout_submit_all_after Observer only triggered from one store view

ce-1.4.1.1event-observerstore-view

Afternoon all,

Run into a curious problem, I'm setting up an observer that will be triggered every time an order is made. Code is below;

Config XML:

<?xml version="1.0"?>
<config>
  <global>
    <models>
        <orderemail>
            <class>Mod_Orderemail_Model</class>
        </orderemail>
    </models>
    <events>
        <checkout_submit_all_after>
            <observers>
                <anything>
                    <type>singleton</type>
                    <class>orderemail/observer</class>
                    <method>sendEmail</method>
                </anything>
            </observers>
        </checkout_submit_all_after>
    </events> 
  </global>
</config>

Model:

<?php
class Mod_Orderemail_Model_Observer
{
    public function sendEmail($observer)
    {
        mail('me@mydomain.co.uk', "Order Submitted", "Mod Orderemail Observer Submitted");
    }
}

The issue I'm having is that the observer is only triggered when orders are submitted from one particular store view, and typically this is the store view I'm not interested in detecting orders from!

Edit: I omitted to say I also use OneStepCheckout, although (even though I need to check again) I'm sure triggers this observer. Interestingly the working Store View doesn't use OSC, just the standard One Page Checkout

Am I missing something stupid here? Mage version is (unfortunately) 1.4.1.1

Thanks,

Best Answer

Outside of OSC - I agree with @FabianBlechschmidt - there may be something breaking the dispatch. In my case a few years back, it was:

<events>
    <checkout_submit_all_after>
        <observers>
            <anything> <!-- <<< THIS NEEDS TO BE UNIQUE -->
                <type>singleton</type>
                <class>orderemail/observer</class>
                <method>sendEmail</method>
            </anything><!-- <<< THIS NEEDS TO BE UNIQUE -->
        </observers>
    </checkout_submit_all_after>
</events> 

I found that it was only running the last module loaded - e.g. if you use <anything> on more than one module - only the last module loaded will execute.

HTH. Cheers.

Related Topic