diff --git a/src/Fixture/Factory/SearchableFixtureFactory.php b/src/Fixture/Factory/SearchableFixtureFactory.php index e7f4de3c..45f7e8e3 100644 --- a/src/Fixture/Factory/SearchableFixtureFactory.php +++ b/src/Fixture/Factory/SearchableFixtureFactory.php @@ -67,6 +67,7 @@ protected function configureOptions(OptionsResolver $resolver): void ->setNormalizer('option', LazyOption::findOneBy($this->productOptionRepository, 'code')) ->setDefault('filterable', false) ->setDefault('searchable', false) + ->setDefault('search_weight', 1) ; } @@ -79,6 +80,7 @@ public function create(array $options = []): SearchableInterface $object = $this->getSearchableObject($options); $object->setFilterable(((bool) $options['filterable']) ?? false); $object->setSearchable(((bool) $options['searchable']) ?? false); + $object->setSearchWeight(((int) $options['search_weight']) ?? 1); return $object; } diff --git a/src/Fixture/SearchableFixture.php b/src/Fixture/SearchableFixture.php index 027d8b1c..dab655f5 100644 --- a/src/Fixture/SearchableFixture.php +++ b/src/Fixture/SearchableFixture.php @@ -50,6 +50,7 @@ protected function configureResourceNode(ArrayNodeDefinition $resourceNode): voi ->scalarNode('option')->end() ->booleanNode('filterable')->defaultValue(true)->end() ->booleanNode('searchable')->defaultValue(true)->end() + ->integerNode('search_weight')->defaultValue(1)->end() ; } } diff --git a/src/Resources/config/sylius/fixtures.yaml b/src/Resources/config/sylius/fixtures.yaml index caeb898a..1d1e6bbc 100644 --- a/src/Resources/config/sylius/fixtures.yaml +++ b/src/Resources/config/sylius/fixtures.yaml @@ -9,15 +9,19 @@ sylius_fixtures: attribute: 'cap_collection' filterable: true searchable: true + search_weight: 5 dress_collection: attribute: 'dress_collection' filterable: true searchable: true + search_weight: 4 dress_height: option: 'dress_height' filterable: true searchable: true + search_weight: 3 dress_size: option: 'dress_size' filterable: true searchable: true + search_weight: 2