'Enlight_Controller_Front_PreDispatch',
[$this, 'onPreDispatch'
],
-100
);
return $router;
} public function onAfterRegisterShop(Enlight_Event_EventArgs
$args) { /** @var Container $container */
$container =
$args->
getSubject();
/** @var RouterInterface $router */
$router =
$container->
get(\Shopware\Components\Routing\RouterInterface::
class);
/** @var \Shopware\Models\Shop\Shop $shop */
$shop =
$container->
get('shop'
);
/** @var Shopware_Components_Config $config */
$config =
$container->
get(Shopware_Components_Config::
class);
// Register the shop (we're too soon)
$config->
setShop($shop);
$context =
$router->
getContext();
$newContext = Context::
createFromShop($shop,
$config);