Skip to content

Commit

Permalink
[BUGFIX] Show error messages in multistep checkout
Browse files Browse the repository at this point in the history
Due to the implementation of the PRG pattern the
errors directly next to the errorneous fields were
no longer displayed.

With this commit the PRG pattern will only be
used if no errors occur during the current step.

Fixes: #532
  • Loading branch information
rintisch committed Jun 17, 2024
1 parent 69db21e commit 1ea1de0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Classes/Controller/Cart/CartController.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ public function showAction(
$currentStep = (int)$this->request->getArgument('step');
}

if ($currentStep && $this->request->getMethod() === 'POST') {
if ($currentStep
&& $this->request->getMethod() === 'POST'
&& !$extbaseAttribute->getOriginalRequestMappingResults()->hasErrors()

Check failure on line 130 in Classes/Controller/Cart/CartController.php

View workflow job for this annotation

GitHub Actions / code-quality (8.1, ^12.4)

Variable $extbaseAttribute might not be defined.

Check failure on line 130 in Classes/Controller/Cart/CartController.php

View workflow job for this annotation

GitHub Actions / code-quality (8.2, ^12.4)

Variable $extbaseAttribute might not be defined.

Check failure on line 130 in Classes/Controller/Cart/CartController.php

View workflow job for this annotation

GitHub Actions / code-quality (8.3, ^12.4)

Variable $extbaseAttribute might not be defined.
) {
return $this->redirect('show', null, null, ['step' => $currentStep])->withStatus(303);
}
// Redirect to step 1 if cart is empty.
Expand Down

0 comments on commit 1ea1de0

Please sign in to comment.