rennat
rennat

Reputation: 2559

Magento modules - where to place my code

I know exactly what I want to do I'm just not sure where to hook into magento so that my code can run just after a payment is confirmed. I am on a rush deadline and haven't had time to read all the docs yet (which are not formatted to keep your attention btw) so I'm unsure of what class actually holds the "mark an order as payment confirmed" logic.

If I find that I can subclass and tell magento to use my class instead or if there is an event system in magento that has slipped past me that would be wonderful.

Basically I have my code already I'm just missing the hook.

Upvotes: 0

Views: 219

Answers (1)

Max Pronko
Max Pronko

Reputation: 1379

Are you looking for this events?

checkout_onepage_controller_success_action

checkout_multishipping_controller_success_action

Like below:

<config>
    <frontend>
        <events>
            <checkout_onepage_controller_success_action>
                <observers>
                    <unique_observer_name>
                        <class>custom_module/observer</class>
                        <method>methodName</method>
                    </unique_observer_name>
                </observers>
            </checkout_onepage_controller_success_action>
        </events>
    </frontend>
</config>

Upvotes: 1

Related Questions