Reputation: 69
I have a plugin which works on shopware 5.2 and 5.3 but doesnt work on 5.1.6. Here is the start file which is called ebTaxApi.php and i believe something should be changed here, but I need help:
<?php
namespace ebTaxApi;
use Shopware\Components\Plugin;
class ebTaxApi extends Plugin
{
/**
* @inheritdoc
*/
public static function getSubscribedEvents()
{
return [
'Enlight_Controller_Dispatcher_ControllerPath_Api_Tax' => 'onGetTaxApiController',
'Enlight_Controller_Front_StartDispatch' => 'onEnlightControllerFrontStartDispatch'
];
}
/**
* @return string
*/
public function onGetTaxApiController()
{
return $this->getPath() . '/Controllers/Api/Tax.php';
}
/**
*
*/
public function onEnlightControllerFrontStartDispatch()
{
$this->container->get('loader')->registerNamespace('Shopware\Components', $this->getPath() . '/Components/');
}
}
THis plugin is verified and works on 5.2 and 5.3 but i have tried to make its way into 5.1.6 but no luck. Also tried to register the namespace using a function but didnt work, the class could not be found. Any help? Thanks
Upvotes: 1
Views: 136
Reputation: 1585
The Plugin-Class you are showing here is based on the new Plugin-System, wich was introduced in Shopware Version 5.2. If you need your Plugin in older Shopware versions, you need to use the legacy plugin system.
Upvotes: 2