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 assume there is no way to conditionally _completely disable_ a checkout step?
Comments
-
i.e. to not redirect to that step at all based on a condition
0 -
I guess there is, since we skip the payment step if the cart is
paid
by a gift card for example0 -
from what I can see the step engine will redirect to each step
0 -
hmm
0 -
You probably will find how to do it via our Gift card integration guide https://documentation.spryker.com/docs/gift-cards-feature-integration-201907
0 -
can't see anything about step engine in there?
0 -
@UKBSFUDEJ could you help here?
0 -
but from what I see the step engine needs to redirect to each step - I would guess that the payment step for gift cards is "hit" but then immediately redirects ... maybe
0 -
@UKGT7RC7P is right, we always step in all steps and execute them. Out of the box you can visually skip them only.
0 -
would be a good feature request?
0 -
i guess sometimes disabling / not considering a step is preferable (even for performance reasons)
0 -
Well, somewhere youβll need to define these business logic when to skip what step and since the steps are constructed in a factory method, youβd need to somehow manipulate what the factory should create for you based on that logic.
0 -
or override the StepEngine and add an interface e.g.
CanBeDisabled
or similar?0 -
public function getCurrentStep(Request $request, AbstractTransfer $dataTransfer) { foreach ($this->steps as $step) { if (!$step->postCondition($dataTransfer) || $request->get('_route') === $step->getStepRoute()) { return $step; } $this->completedSteps[] = $step; } return end($this->completedSteps); }
would need to be changed
0 -
but for now I'm just going to allow the redirect
0 -
Will not make your life easier to have the checkout steps defined as a state machine?
0 -
in general yes π not necessarily in this specific case
0 -
Maybe it helps, We do skip Shipment step, as we prefill that in the cart already. This way our tpl redirects to payment from address
0 -
so PostCondition of ShipmentStep is fullfilled
0 -
yes - that's fine - but the shipment step will still be redirected to, and it has to call the step engine to decide if it should redirect or not - so it's not really "disabled"
0 -
To not lost your requirements or problems please create a dedicated idea in our portal https://spryker.ideas.aha.io/ideas
0 -
I don't think so, if you directly call checkout/payment
0 -
in that case yes - but if you hit a previous step it will go through shipment
0 -
hmm true
0 -
@jeremy.fourna is changing the step engine to a state machine a thing?
0 -
would be very nice to have a graph in some cases
0 -
it is something that I have in the back of my mind to allow different checkout process depending on your cart or just to have different process per store or mobile vs desktop
0 -
would be awesome π
0 -
then create the idea for it, maybe if it get a lot of votes from the community you will get it soon lol
0 -
Up for it too π
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random