0

I am working In Magento 2 Module, I've to do some customization on Magento Onepage checkout, for that I plan to use the checkout_onepage_controller_success_action, but In my project, We're installed some third-party modules, which are already used this event.

So, I believe if I again use the same event It won't work, an observer doesn't have an order to execute.

I want the equivalent event of checkout_onepage_controller_success_action. Is there have anything in Magento 2 Kindly let me know it.

1 Answer 1

0

Magento 2 does not have any event equivalent to checkout_onepage_controller_success_action.

One solution you can try to make a different module for different Observer.

And Make one module depends on another.

Let's give an example:

  • ModuleA: Observer class ObserverClassA.
  • ModuleB: Observer Class ObserverClassB.

Assume that ObserverClassB need to run after ObserverClassA .

So, please make ModuleB is module depend on ModuleA.

Add sequence on ModuleB's module.xml file.

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="ModuleB" setup_version="0.0.1">
        <sequence>
        <!-- Vendor_ComponentB is dependent on Vendor_ComponentA: -->
            <module name="ModuleA" />
        </sequence>
    </module>
</config>

After that don't forgot run setup upgrade to apply these changes.

I guess that it will resolve your issue.

4
  • Magento has the event (checkout_onepage_controller_success_action) check the below meetanshi.com/blog/magento-2-events
    – senthil
    Commented Mar 20, 2020 at 10:43
  • What you mean Sorry Don't understand. I don't say the event does not exist.
    – Amit Bera
    Commented Mar 20, 2020 at 11:08
  • I guess that your issue at your observers code.Please share the code of two observers.
    – Amit Bera
    Commented Mar 20, 2020 at 11:10
  • Magento 2 3 core module are used same events. vendor/magento/module-google-adwords/etc/frontend/events.xml,vendor/magento/module-google-analytics/etc/frontend/events.xml,vendor/magento/module-signifyd/etc/events.xml
    – Amit Bera
    Commented Mar 20, 2020 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.