public function getStorefrontSnippets(MessageCatalogueInterface
$catalog, string
$snippetSetId, ?string
$fallbackLocale = null, ?string
$salesChannelId = null
): array
{ $locale =
$this->
getLocaleBySnippetSetId($snippetSetId);
$snippets =
[];
$snippetFileCollection =
$this->snippetFileCollection;
$usingThemes =
$this->
getUsedThemes($salesChannelId);
$unusedThemes =
$this->
getUnusedThemes($usingThemes);
$snippetCollection =
$snippetFileCollection->
filter(fn (AbstractSnippetFile
$snippetFile) => !\
in_array($snippetFile->
getTechnicalName(),
$unusedThemes, true
));
$fallbackSnippets =
[];
if ($fallbackLocale !== null
) { // fallback has to be the base
$snippets =
$fallbackSnippets =
$this->
getSnippetsByLocale($snippetCollection,
$fallbackLocale);
} // now override fallback with defaults in catalog
$snippets =
array_replace_recursive(