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..

Hi there. I'm trying to add a custom step to the Yves Checkout Page. I have my step ready (implement

U04BCHQVACE
U04BCHQVACE Posts: 39 πŸ§‘πŸ»β€πŸš€ - Cadet

Hi there. I'm trying to add a custom step to the Yves Checkout Page. I have my step ready (implemented the right interfaces and extended the quote transfer, created twig templates and forms, etc). However, I'm having issues wiring up everything together. For instance, the standard steps are created here, and passed to the step resolver here. Is there a way I can override this and insert my custom step before the Payment Step?

My guess is to extend and override the StepFactory under the Process folder. Can be that done in the Pyz folder under src? I'm asking because this factory is outside the traditional location (root of the module), and invoked by the main factory here, so that's why I'm a bit confused.

I hope that was clear enough. Any help would be greatly appreciated! πŸ™‚

Comments

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited December 2022

    Hi, just extend CheckoutPageFactory in Pyz/Yves/CheckoutPage and override

    /**
     * @return \Pyz\Yves\CheckoutPage\Process\StepFactory
     */
    public function createStepFactory(): StepFactory
    {
        return new StepFactory();
    }
    
  • U04BCHQVACE
    U04BCHQVACE Posts: 39 πŸ§‘πŸ»β€πŸš€ - Cadet

    Oh okay cool, and I can then extend that StepFactory or implement my own. Thanks! πŸ™‚

  • UK7KBE2JW
    UK7KBE2JW Posts: 463 πŸ§‘πŸ»β€πŸš€ - Cadet

    sure

  • sebastian.larisch
    sebastian.larisch Spryker Customer Posts: 143 πŸ§‘πŸ»β€πŸš€ - Cadet

    there was a similar thread days ago which is also pointing to the (outdated) docu and how he solved it: https://sprykercommunity.slack.com/archives/CKJRJM5FG/p1669219555825659 … maybe helps

  • U04BCHQVACE
    U04BCHQVACE Posts: 39 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thanks! I'll have a look!

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βš–οΈ - Guardians (admin)
    edited December 2022

    actually i am currently updating exactly that docu based on the feedback. hopefully it is online next week πŸ™‚

  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,084 βš–οΈ - Guardians (admin)

    (taking Sebastians PR and fix also all the other parts which are outdated)

  • U04BCHQVACE
    U04BCHQVACE Posts: 39 πŸ§‘πŸ»β€πŸš€ - Cadet

    Thank you guys. I've made it work now.

    It would be cool to document a way of doing it without using too much inheritance. Obviously there is a ton of functionality that need to be reused in checkout (forms, step engine, router, etc) so I would not know how.