getEmotionTranslations example

$zip->addFromString($zipPath$fileContent);
            $path = $zipPath;
        }
        unset($path);

        $syncData->set('assets', $assets);
        $presetData['syncData'] = $syncData->all();

        $exportData = [
            'requiredPlugins' => json_decode($preset->getRequiredPlugins(), true),
            'emotionTranslations' => $preset->getEmotionTranslations(),
            'presetData' => json_encode($presetData),
        ];

        $zip->addFromString('emotion.json', json_encode($exportData, JSON_THROW_ON_ERROR));

        if (!$zip->close()) {
            throw new Exception(sprintf('Could not close zip file "%s"!', $filename));
        }

        $this->presetResource->delete($preset->getId());

        
sys_get_temp_dir(),
            DIRECTORY_SEPARATOR,
            basename($this->Request()->get('filePath'))
        );

        $preset = $this->container->get('shopware.emotion.emotion_importer')->import($filePath);

        $this->View()->assign([
            'success' => true,
            'presetId' => $preset->getId(),
            'presetData' => $preset->getPresetData(),
            'emotionTranslations' => $preset->getEmotionTranslations(),
        ]);
    }

    /** * Execute cleanup on imported emotion files. * * @throws InvalidArgumentException If the passed filePath is empty (code: 1) * * @return void */
    public function afterImportAction()
    {
Home | Imprint | This part of the site doesn't use cookies.