Reputation: 43
I will get following exception in Shopware6:
Class "WtCustomerRegistration\Subscriber\CustomerRegistration" used for service "WtCustomerRegistration
\Subscriber\CustomerRegistration" cannot be found.
At my local system, everything is running fine, but not at live system. What is wrong with it?All namespaces seem to be all right. i absolutely have no idea, how to fix this. If U need more informations, please tell me!
Here is compopser.json:
{
"name": "wt-customer-registration/wt-customer-registration",
"description": "Deactivate customer account",
"authors": [
{
"name": "Kipp,Thomas",
"email": "[email protected]",
"homepage": "https://tklustig.de",
"role": "Developer"
}
],
"type": "shopware-platform-plugin",
"version": "1.0.0",
"license": "MIT",
"require": {
"shopware/core": "6.*.*"
},
"extra": {
"shopware-plugin-class": "WtCustomerRegistration\\WtCustomerRegistration",
"label": {
"de-DE": "Product Registration Plugin",
"en-GB": "Product Registration Plugin"
}
},
"autoload": {
"psr-4": {
"WtCustomerRegistration\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"WtCustomerRegistration\\Tests\\": "tests/"
}
}
}
Here is 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="WtCustomerRegistration\Subscriber\CustomerRegistration">
<argument type="service" id="WtCustomerRegistration\Service\Mailer"/>
<argument type="service" id="WtCustomerRegistration\Service\ContactDatabase"/>
<tag name="kernel.event_subscriber"/>
</service>
<service id="WtCustomerRegistration\Service\Mailer">
<argument id="Shopware\Core\Content\MailTemplate\Service\MailService" type="service"/>
</service>
<service id="WtCustomerRegistration\Service\ContactDatabase">
<argument type="service" id="customer.repository"/>
</service>
</services>
</container>
and here is Subscriber class:
<?php declare(strict_types=1);
namespace WtCustomerRegistration\Subscriber;
use Symfony\Component\HttpFoundation\Response;
use Shopware\Core\Checkout\Customer\Event\CustomerRegisterEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use WtCustomerRegistration\Service\Mailer;
use WtCustomerRegistration\Service\ContactDatabase;
use DateTime;
use DateInterval;
use Throwable;
/**
*
*/
class CustomerRegistration implements EventSubscriberInterface
{
...
}
Upvotes: 0
Views: 39