Skip to content

Commit b1c7f56

Browse files
Heureka categories for SK domains (#4216)
2 parents bdb5005 + 100515b commit b1c7f56

3 files changed

Lines changed: 37 additions & 1 deletion

File tree

src/Component/Domain/Domain.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,4 +321,9 @@ public function isMainDomainWithinSameBaseUrlGroup(DomainConfig $domainConfig):
321321

322322
return true;
323323
}
324+
325+
public function anyDomainHasLocale(string $locale): bool
326+
{
327+
return in_array($locale, $this->getAllLocales(), true);
328+
}
324329
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Shopsys\FrameworkBundle\Migrations;
6+
7+
use Doctrine\DBAL\Schema\Schema;
8+
use Override;
9+
use Shopsys\MigrationBundle\Component\Doctrine\Migrations\AbstractMigration;
10+
11+
class Version20260223133152 extends AbstractMigration
12+
{
13+
#[Override]
14+
public function up(Schema $schema): void
15+
{
16+
$this->sql('ALTER TABLE heureka_category ADD locale VARCHAR(255) NOT NULL DEFAULT \'cs\'');
17+
$this->sql('ALTER TABLE heureka_category ALTER locale DROP DEFAULT');
18+
19+
$this->sql('ALTER TABLE heureka_category ADD heureka_id INT NOT NULL DEFAULT 0');
20+
$this->sql('ALTER TABLE heureka_category ALTER heureka_id DROP DEFAULT');
21+
$this->sql('UPDATE heureka_category SET heureka_id = id');
22+
23+
$this->sql('CREATE SEQUENCE heureka_category_id_seq');
24+
$this->sql('SELECT setval(\'heureka_category_id_seq\', (SELECT MAX(id) FROM heureka_category))');
25+
$this->sql('ALTER TABLE heureka_category ALTER id SET DEFAULT nextval(\'heureka_category_id_seq\')');
26+
27+
$this->sql('DROP INDEX uniq_fe112a6912469de2;');
28+
29+
$this->sql('CREATE UNIQUE INDEX uq_heureka_category_heureka_id_locale ON heureka_category (locale, heureka_id)');
30+
$this->sql('CREATE INDEX IDX_FE112A6912469DE2 ON heureka_category_categories (category_id)');
31+
}
32+
}

src/Model/AdvancedSearch/Filter/ProductCategoryFilter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ public function getValueFormOptions(): array
7373
return $padding . $category->getName();
7474
},
7575
'choice_value' => 'id',
76-
'attr' => ['class' => 'js-autocomplete-selectbox'],
7776
];
7877
}
7978

0 commit comments

Comments
 (0)