Kundengruppe mittels Plugin auslesen

Danke für die wertvollen Inputs. Ich hab jetzt folgende 2 Varianten probiert. Bei beiden bekomme ich die Kundengruppe nicht im Frontend auf einer Shopseite mittels {$sCustomerUserGroup} angezeigt. Und im Backend kommt eine Fehlermeldung. Variante 1: class Shopware\_Plugins\_Frontend\_SwagGetUserGroup\_Bootstrap extends Shopware\_Components\_Plugin\_Bootstrap { public function install() { $this-\>subscribeEvent('Enlight\_Controller\_Action\_PostDispatch\_Frontend\_Index','onPostDispatchFrontend'); return true; } public function onPostDispatchFrontend(Enlight\_Event\_EventArgs $args) { $controller = $args-\>getSubject(); $request = $controller-\>Request(); $response = $controller-\>Response(); $view = $controller-\>View(); if(!$request-\>isDispatched() || $response-\>isException() || !$view-\>hasTemplate()) { return; } $CustomerUserGroup = Shopware()-\>Session()-\>sUserGroup; $args-\>getSubject()-\>View()-\>assign("sCustomerUserGroup",$CustomerUserGroup); } } Variante 2: class Shopware\_Plugins\_Frontend\_SwagGetUserGroup\_Bootstrap extends Shopware\_Components\_Plugin\_Bootstrap { public function install() { $this-\>subscribeEvent('Enlight\_Controller\_Action\_PostDispatch\_Frontend\_Index','onPostDispatchFrontend'); return true; } public function onPostDispatchFrontend(Enlight\_Event\_EventArgs $args) { $controller = $args-\>getSubject(); $request = $controller-\>Request(); $response = $controller-\>Response(); $view = $controller-\>View(); if(!$request-\>isDispatched() || $response-\>isException() || !$view-\>hasTemplate()) { return; } $customerId = Shopware()-\>Session()-\>sUserId; $CustomerUserGroup = $this-\>getCustomerUserGroup($customerId); $args-\>getSubject()-\>View()-\>assign("sCustomerUserGroup",$CustomerUserGroup); } private function getCustomerUserGroup($customerId) { $sql = "SELECT customergroup FROM s\_user WHERE id = ?"; $customerGroup = Shopware()-\>Db()-\>fetchOne($sql, array($customerId)); return $customerGroup; } } Fehler im Backend: Resource "shop" not found failure in Shopware/Components/DependencyInjection/Container.php on line 192 #7 Shopware/Plugins/Community/Frontend/SwagGetUserGroup/Bootstrap.php(31): Shopware-\>Session() #8 Enlight/Event/Handler/Plugin.php(149): Shopware\_Plugins\_Frontend\_SwagGetUserGroup\_Bootstrap-\>onPostDispatchFrontend(Object(Enlight\_Controller\_ActionEventArgs)) Könntet ihr bitte so lieb sein und nochmal drüberschauen? Danke!