fixShopHost example

public function sGetImageLink($hash$imageSize = null)
    {
        if (empty($hash)) {
            return '';
        }

        $mediaService = Shopware()->Container()->get(MediaServiceInterface::class);
        $thumbnailManager = Shopware()->Container()->get(Manager::class);

        // If no imageSize was set, return the full image         if ($imageSize === null) {
            return $this->fixShopHost($mediaService->getUrl($hash)$mediaService->getAdapterType());
        }

        // Get filename and extension in order to insert thumbnail size later         $extension = pathinfo($hash, PATHINFO_EXTENSION);
        $fileName = pathinfo($hash, PATHINFO_FILENAME);

        // Get thumbnail sizes         $sizes = [];
        if ($this->articleMediaAlbum) {
            $settings = $this->articleMediaAlbum->getSettings();
            if ($settings) {
                
Home | Imprint | This part of the site doesn't use cookies.