How do I perform a redirect to the cart? I'm trying to redirect the user to the cart from a custom page using the following code.

return new RedirectResponse(\Drupal::url('cart'));


Is there a function to go directly to the cartrce? If not, what is the route name for the cart page?
If you use the Devel module, you could also find the right routes on "/devel/routes".

An then do something like:

  $url = Url::fromRoute('commerce_cart.page');

  //$url-&gt;toString();
  $form_state-&gt;setRedirectUrl($url);