getSnippetsByLocale example

$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(
            $snippets,
            $catalog->all('messages')
        );

        // after fallback and default catalog merged, overwrite them with current locale snippets         $snippets = array_replace_recursive(
            $snippets,
            
Home | Imprint | This part of the site doesn't use cookies.