getExistingSortingTranslations example

return null;
    }

    private function importSortingTranslations()
    {
        $shops = $this->connection->query('SELECT id, main_id, locale_id FROM s_core_shops')->fetchAll(PDO::FETCH_ASSOC);

        foreach ($shops as $shop) {
            $translationShopId = $shop['main_id'] ?: $shop['id'];
            $localeId = $shop['locale_id'];

            $insert = $this->getExistingSortingTranslations($translationShopId$localeId);

            if (!empty($insert)) {
                $statement = $this->connection->prepare(
                    "INSERT IGNORE INTO s_core_translations (objecttype, objectdata, objectkey, objectlanguage) VALUES ('custom_sorting', :data, :key, :language)"
                );

                $statement->execute([
                    ':data' => serialize($insert),
                    ':key' => '1',
                    ':language' => $shop['id'],
                ]);
$this->addSql($sql);
    }

    private function importFacetTranslations()
    {
        $shops = $this->connection->query('SELECT id, main_id, locale_id FROM s_core_shops')->fetchAll(PDO::FETCH_ASSOC);

        foreach ($shops as $shop) {
            $translationShopId = $shop['main_id'] ?: $shop['id'];
            $localeId = $shop['locale_id'];

            $insert = $this->getExistingSortingTranslations($translationShopId$localeId);

            if (!empty($insert)) {
                $this->addSql(
                    "INSERT INTO s_core_translations (objecttype, objectdata, objectkey, objectlanguage) VALUES ('custom_facet', '" . serialize($insert) . "', '1', " . $shop['id'] . ')'
                );
            }
        }
    }

    /** * @param int $translationShopId * @param int $localeId * * @return array */
public function up($modus)
    {
        $this->updateTranslation();
        $this->updateCustomerFacetAndSorting();
    }

    private function updateTranslation(): void
    {
        $shops = $this->connection->query('SELECT id FROM s_core_shops')->fetchAll(PDO::FETCH_ASSOC);

        foreach ($shops as $shop) {
            $translation = $this->getExistingSortingTranslations((int) $shop['id']);

            if (!empty($translation)) {
                $id = $translation['id'];
                $data = unserialize($translation['objectdata']);

                $default = [
                    1 => ['label' => 'Categories'],
                    2 => ['label' => 'Immediately available'],
                    3 => ['label' => 'Manufacturer'],
                    4 => ['label' => 'Price'],
                    6 => ['label' => 'Shipping free'],
                    
Home | Imprint | This part of the site doesn't use cookies.