In twig I can access my theme config values via theme_config.
I am looking for a way to do this cleanly in a subscriber.
I tried to get them via the Shopware\Storefront\Theme\ThemeConfigValueAccessor:
$salesChannelContext = $event->getSalesChannelContext();
$this->themeConfigAccessor->get('theme-config-value-key', $salesChannelContext, null);
But I need the $themeId
as a third parameter and I did not find a way to
get the Theme of a current SalesChannel, without reading from the DB.
Does someone have a solution for this case? Is there a best practice way?