Calling Developers!
We are reenergizing our code contribution process! Learn More

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 guys πŸ‘‹ i was wondering, what is supposed to happen if some CheckoutPreConditionPlugin create

Options
U032KG3CGNB
U032KG3CGNB Posts: 2 πŸ§‘πŸ»β€πŸš€ - Cadet

Hi guys πŸ‘‹ i was wondering, what is supposed to happen if some CheckoutPreConditionPlugin created an Error without an ErrorCode? E.g. https://github.com/spryker/gift-card/blob/94c737ef332b228613346dc1deaff36f54ab5d7b[…]/Spryker/Zed/GiftCard/Business/Payment/SalesOrderPreChecker.php adds an Error without an ErrorCode to the CheckoutResponse if the GiftCard is already used. So the PlaceOrderStep will not have a postConditionErrorRoute and the StepCollections Error Route checkout-error will be used. But because of the PlaceOrderSteps PostCondition $quoteTransfer->getOrderReference() !== null the ErrorSteps PostCondition $quoteTransfer->getOrderReference() === null can never be triggered. The Result is an infinite redirect from place-order-step to error-step and so on. Am i missing something here?

Comments

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

    Yes, this is sadly a bug 😞 If you have access through a partner or customer portal you can report it to get better attention

  • U032KG3CGNB
    U032KG3CGNB Posts: 2 πŸ§‘πŸ»β€πŸš€ - Cadet
    Options

    All right i'll report it then, thank you very much πŸ‘Œ

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

    Workaround which worked for me to not have the loop:

    <?php
    
    namespace Pyz\Yves\CheckoutPage\Process;
    
    use Spryker\Yves\StepEngine\Process\StepCollection;
    use SprykerShop\Yves\CheckoutPage\Plugin\Router\CheckoutPageRouteProviderPlugin;
    use SprykerShop\Yves\CheckoutPage\Process\StepFactory as SprykerStepFactory;
    
    class StepFactory extends SprykerStepFactory
    {
        /**
         * @return \Spryker\Yves\StepEngine\Process\StepCollectionInterface
         */
        public function createStepCollection()
        {
            return new StepCollection(
                $this->getRouter(),
                CheckoutPageRouteProviderPlugin::ROUTE_NAME_CHECKOUT_SUMMARY
            );
        }
    }
    
  • fsmeier
    fsmeier Senior Software Engineer & Developer Enablement Advocate Sprykee Posts: 1,034 βš–οΈ - Guardians (admin)
    Options

    Routing not to error-route but using the summary as default error-route

  • Alberto Reyer
    Alberto Reyer Lead Spryker Solution Architect / Technical Director Posts: 690 πŸͺ - Explorer
    Options

    @U01F7P3D9NH Seems like a solution for the same issue we have as well, what do you think?