What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

I'm looking for a way to hook up into the order lifecycle. I'm particularly interested on when the o

Options
U04BCHQVACE
U04BCHQVACE Posts: 39 🧑🏻‍🚀 - Cadet

I'm looking for a way to hook up into the order lifecycle. I'm particularly interested on when the order is placed, paid, fulfilled or cancelled. It would also be good to subscribe to payments and refunds. I've been looking into the docs and the code but I don't seem to find anything. Could anyone point me to the list of events in the code or some relevant documentation? I'd greatly appreciate it. 🙂

Comments

  • Chemaclass
    Chemaclass Tech Lead Spryker Solution Partner Posts: 213 🧑🏻‍🚀 - Cadet
    Options
  • U04BCHQVACE
    U04BCHQVACE Posts: 39 🧑🏻‍🚀 - Cadet
    edited December 2022
    Options

    Thanks @U015S0C0V29. I assume there is a default OMS implementation for the demo store. Where could I find that xml?

  • Chemaclass
    Chemaclass Tech Lead Spryker Solution Partner Posts: 213 🧑🏻‍🚀 - Cadet
    edited December 2022
    Options

    That’s right. Look for example if you have a: config/Zed/oms/TestOrderPayment01.xml this is the state machine with the flow of an order with that payment method.

    If you look in your config_default.php you will luckily find the mapping between a payment method to the right OMS state machine version attached to it. eg:

    $config[SalesConstants::PAYMENT_METHOD_STATEMACHINE_MAPPING] = [
        TestOrderPaymentConstants::METHOD => 'TestOrderPayment01',
        // ...
    ];
    
  • U04BCHQVACE
    U04BCHQVACE Posts: 39 🧑🏻‍🚀 - Cadet
    Options

    Cheers Chema! Much appreciated!

  • U04BCHQVACE
    U04BCHQVACE Posts: 39 🧑🏻‍🚀 - Cadet
    Options

    I guess now looking in the commands under Oms I could see what events they fire?

  • Chemaclass
    Chemaclass Tech Lead Spryker Solution Partner Posts: 213 🧑🏻‍🚀 - Cadet
    Options

    Yes, exactly in that oms yaml files you will find which commands/conditions are being trigger, and you can subscribe to any of them and do whatever you want between those transitions. This is a pretty complex area, but I think this is an easy way to start looking at it 🙂

  • U04BCHQVACE
    U04BCHQVACE Posts: 39 🧑🏻‍🚀 - Cadet
    Options

    Yeah, I have not touched this part of Spryker yet, so I'm in for a fun weekend 😆