Redirect after purchasing How can I perform a redirect after purchasing a product? I tried to create a custom checkout pane for this purpose, but it doesn't work as the form is not submited:

public function buildPaneForm(array $pane_form, FormStateInterface $form_state, array &amp;$complete_form) {
  if ($this-&gt;getStepId() == 'complete') {
    $form_state-&gt;setRedirect('&lt;front&gt;');
  }
}


Is there any possibility to do this with a pane or do I have to create an event subscriber and redirect on the checkout event?
In your "submitForm" method write below code:

$form_state-&gt;setRedirect('&lt;front&gt;');
return;


To redirect you can also use the following code:

//after the namespace
use Drupal\Core\Url;

//In your "submitForm"
$url = Url::fromRoute('&lt;front&gt;');
$form_state-&gt;setRedirectUrl($url);


To redirect you can also use the following code:

//after the namespace
use Symfony\Component\HttpFoundation\RedirectResponse;

//In your "submitForm"
global $base_url;
$response = new RedirectResponse($base_url);
$response-&gt;send();
return;