Shopware plugin works on 5.2 and 5.3 but doesnt work on 5.1.6

Hi community! 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:

 '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/');
    }
}

Any help is appreciated. Thanks in advance!

 

Hello,

this part:

$this->container->get('loader')->registerNamespace('Shopware\Components', $this->getPath() . '/Components/');

you can only use in shopware versions over 5.2. This function:

getSubscribedEvents()

too.

Seems you are using the new plugin system. Since it is only available for 5.2+ installations, it won’t work on 5.1.6.

Thank you, I already know that haha its fixed by the way, thanks everyone