I'm developing a Shopware plugin using the 5.2 plugin system and I'm having trouble registering a hook into a method of the sBasket module.
What I'm trying to achieve is to get notified when an article is removed from the shopping basket, to be able to remove other articles automatically (the articles are correlated and it doesn't make sense to have one in the basket if the other one is removed).
So far my plugin bootstrap looks as follows:
class MyTestPlugin extends \Shopware\Components\Plugin {
public static function getSubscribedEvents() {
return [
'Shopware_Modules_Basket_AddArticle_Start' => 'onBasketAddArticle',
'sBasket::sDeleteArticle::after' => 'onBasketDeleteArticle'
];
}
// Handler methods declared here...
}
The "AddArticle_Start" event registration works as expected, that is, the "onBasketAddArticle" handler is called when I add articles to the basket. The sBasket hook, however, isn't invoked.
I suspect that I'm mixing up legacy and new plugin system here and that hooks maybe have to be registered another way than events, but I can't find anything in the Shopware documentation.
Any help appreciated.