Shopware Registrierungs-Controller überschreiben

Hallo,

ich habe ein Registrierungsformular für meine Händler-Kundengruppe aktiviert.
Dieses möchte ich nun als Standard-Registrierungsformular einstellen, da sich der Shop nur an Händler richtet.

Soweit ich gesehen habe, gibt es dafür keine Möglichkeit, das über eine Einstellung zu lösen.
Meine Idee ist es also, den RegisterController.php zu überschreiben und in der Route „/account/register“ auf mein Händler-Registrierungsformular zu verweisen.

Hier fangen nun aber die Probleme an. Im Prinzip habe ich einfach den Inhalt der Funktion „customerGroupRegistration“ in meine Funktion „accountRegisterPage“ kopiert, welche ja zum gewünschten „/account/register“ routet. Die Kundengruppen-ID habe ich hart kodiert.

Leider bekomme ich diesen Fehler:

Argument 1 (also $request), welches in dieser Zeile an die Load-Funktion übergeben wird, ist wohl null.

$page = $this->customerGroupRegistrationPageLoader->load($request, $context);

Kann mir bitte jemand weiterhelfen? Ich komme nicht weiter. Auch die Dokumentation hilft nicht weiter.

Hier mein Plugin-Code:

RegisterController.php

<?php declare(strict_types=1);

namespace MhRegister\Storefront\Controller;

use Shopware\Storefront\Controller\StorefrontController;
...
use Symfony\Component\Validator\Constraints\NotBlank;

/**
 * @RouteScope(scopes={"storefront"})
 */
class RegisterController extends StorefrontController
{

    private AbstractCustomerGroupRegistrationPageLoader $customerGroupRegistrationPageLoader;

    public function __construct(
        AbstractCustomerGroupRegistrationPageLoader $customerGroupRegistrationPageLoader
    ) {
        $this->customerGroupRegistrationPageLoader = $customerGroupRegistrationPageLoader;
    }

    /**
     * @Since("6.0.0.0")
     * @Route("/account/register", name="frontend.account.register.page", methods={"POST"})
     */
    public function accountRegisterPage(Request $request, RequestDataBag $data, SalesChannelContext $context): Response
    {
        $customerGroupId = '0x1E3A326154B74BC9BAD7707117EC5804';

        if ($context->getCustomer() && $context->getCustomer()->getGuest()) {
            return $this->redirectToRoute('frontend.account.logout.page');
        }

        if ($context->getCustomer()) {
            return $this->redirectToRoute('frontend.account.home.page');
        }

        $redirect = $request->query->get('redirectTo', 'frontend.account.home.page');

        $page = $this->customerGroupRegistrationPageLoader->load($request, $context);

        if ($page->getGroup()->getTranslation('registrationOnlyCompanyRegistration')) {
            $data->set('accountType', CustomerEntity::ACCOUNT_TYPE_BUSINESS);
        }

        return $this->renderStorefront('@Storefront/storefront/page/account/customer-group-register/index.html.twig', [
            'redirectTo' => $redirect,
            'redirectParameters' => $request->get('redirectParameters', json_encode([])),
            'errorParameters' => json_encode(['customerGroupId' => $customerGroupId]),
            'page' => $page,
            'data' => $data,
        ]);
       }

    }

Services.xml:

<?xml version="1.0" ?>

<container xmlns="http://symfony.com/schema/dic/services"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

    <services>
        <service id="MhRegister\Storefront\Controller\RegisterController" public="true" autowire="true">
            <argument type="service" id="Shopware\Storefront\Page\Account\CustomerGroupRegistration\CustomerGroupRegistrationPageLoader"/>
            <call method="setContainer">
                <argument type="service" id="service_container"/>
            </call>
        </service>
    </services>
</container>