diff --git a/resources/lang/de/Widget.properties b/resources/lang/de/Widget.properties index 3f0a509815..5ba34d1db3 100644 --- a/resources/lang/de/Widget.properties +++ b/resources/lang/de/Widget.properties @@ -930,6 +930,7 @@ availabilityFilterLabel = "Verfügbarkeitsfilter" priceFilterLabel = "Preisfilter" ; Category filter categoryFilterLabel = "Kategoriefilter" +categoryPlaceholderDescription = "Dieses Widget ist nur sichtbar, wenn die Einstellung 'Kategorien als Filteroptionen bei Suchergebnissen anzeigen' im plentyShop-Assistenten aktiv ist." ; Selected Filter selectedFilterWidgetLabel = "Ausgewählte Filter" ; Manufacturer Filter diff --git a/resources/lang/de/Wizard.properties b/resources/lang/de/Wizard.properties index 74622acdf4..af63d3777c 100644 --- a/resources/lang/de/Wizard.properties +++ b/resources/lang/de/Wizard.properties @@ -247,6 +247,7 @@ categoryDescriptionBoth = Beschreibung 1 und 2 categoryDescriptionBelow = Welche Kategoriebeschreibung möchtest du unter der Artikelliste anzeigen? enableImageCarousel = Bilderkarussell in der Kategorieansicht aktivieren showCarouselDots = Punkte-Navigation unten im Bilderkarussell anzeigen +showCategoryFilter = Kategorien als Filteroptionen bei Suchergebnissen anzeigen showCarouselNav = Navigationspfeile zum Steuern des Bilderkarussells anzeigen itemViewSettings = Einstellungen für die Artikelansicht itemViewSettingsDescription = Bestellmerkmale in der Artikelansicht diff --git a/resources/lang/en/Widget.properties b/resources/lang/en/Widget.properties index cdc08c7bf4..9a9fd9b670 100644 --- a/resources/lang/en/Widget.properties +++ b/resources/lang/en/Widget.properties @@ -928,6 +928,7 @@ availabilityFilterLabel = "Availability filter" priceFilterLabel = "Price filter" ; Category filter categoryFilterLabel = "Category filter" +categoryPlaceholderDescription = "This widget is only visible if the setting 'Show categories as filter options for search results' in the plentyShop assistant is active." ; Selected Filter selectedFilterWidgetLabel = "Selected filters" ; Manufacturer Filter @@ -1015,4 +1016,4 @@ maxPreloadTooltip = "Number of images to be preloaded" ; LanguageDetection languageDetectionLabel = "Language detection" languageDetectionWidgetLabel = "Language detection" -languageDetectionRedirect = "Activate automatic redirect" \ No newline at end of file +languageDetectionRedirect = "Activate automatic redirect" diff --git a/resources/lang/en/Wizard.properties b/resources/lang/en/Wizard.properties index 7ac4816fb5..68046f3499 100644 --- a/resources/lang/en/Wizard.properties +++ b/resources/lang/en/Wizard.properties @@ -247,6 +247,7 @@ categoryDescriptionBoth = Description 1 and 2 categoryDescriptionBelow = Which category description do you want to display below item lists? enableImageCarousel = Show image carousel in the category view showCarouselDots = Show dot navigation in the image carousel +showCategoryFilter = Show categories as filter options for search results showCarouselNav = Show navigation arrows in the image carousel itemViewSettings = Settings for the item view itemViewSettingsDescription = Order characteristics in the item view diff --git a/resources/views/Widgets/Category/Filter/FilterBaseWidget.twig b/resources/views/Widgets/Category/Filter/FilterBaseWidget.twig index 5e5e34462a..859b6584d7 100644 --- a/resources/views/Widgets/Category/Filter/FilterBaseWidget.twig +++ b/resources/views/Widgets/Category/Filter/FilterBaseWidget.twig @@ -10,17 +10,29 @@ {% set appearance = widget.settings.appearance.mobile | default("none") %} +{{ Twig.set("hasCategoryFilter", "ceresConfig.item.showCategoryFilter") }} +{{ Twig.set("className", "className") }} + {{ Twig.if("services.facet.facetDataExists(facets, #{allowedFacetTypes | json_encode}) or #{ isPreview | json_encode }") }}
{{ Twig.endif() }} diff --git a/src/Config/CeresItemConfig.php b/src/Config/CeresItemConfig.php index abe8f65f2d..28fff71c2b 100644 --- a/src/Config/CeresItemConfig.php +++ b/src/Config/CeresItemConfig.php @@ -170,6 +170,6 @@ protected function load() $this->showCategoryDescriptionTop = $this->getTextValue( 'item.show_category_description_top', 'description1' ); $this->showCategoryDescriptionBottom = $this->getTextValue( 'item.show_category_description_bottom', 'none' ); $this->requireOrderProperties = $this->getBooleanValue( 'item.require_all_properties', false ); - + $this->showCategoryFilter = $this->getBooleanValue( 'item.show_category_filter', false ); } } diff --git a/src/Widgets/Category/Filter/FilterBaseWidget.php b/src/Widgets/Category/Filter/FilterBaseWidget.php index 12218f014c..d5e2c14eda 100644 --- a/src/Widgets/Category/Filter/FilterBaseWidget.php +++ b/src/Widgets/Category/Filter/FilterBaseWidget.php @@ -82,7 +82,10 @@ protected function getPreviewData($widgetSettings) /** @var FacetFaker $facetFaker */ $facetFaker = pluginApp(FacetFaker::class); $facetResult = $facetFaker->fill([]); - - return ['facets' => $facetResult]; + + return [ + 'facets' => $facetResult, + 'className' => $this->className + ]; } } diff --git a/src/Wizard/ShopWizard/Mapping/DisplayInfoMapping.php b/src/Wizard/ShopWizard/Mapping/DisplayInfoMapping.php index d7965139ae..e092f35436 100644 --- a/src/Wizard/ShopWizard/Mapping/DisplayInfoMapping.php +++ b/src/Wizard/ShopWizard/Mapping/DisplayInfoMapping.php @@ -27,6 +27,12 @@ class DisplayInfoMapping "global" => false, "optional" => true, ], + "displayInfo_showCategoryFilter"=> [ + "field" => "item.show_category_filter", + "type" => "string", + "global" => false, + "optional" => true, + ], "displayInfo_showDescriptionTop" => [ "field" => "item.show_category_description_top", "type" => "string", diff --git a/src/Wizard/ShopWizard/Steps/Builder/DisplayedInformationStep.php b/src/Wizard/ShopWizard/Steps/Builder/DisplayedInformationStep.php index f9f7c53556..bfa0f4c1f8 100644 --- a/src/Wizard/ShopWizard/Steps/Builder/DisplayedInformationStep.php +++ b/src/Wizard/ShopWizard/Steps/Builder/DisplayedInformationStep.php @@ -147,6 +147,13 @@ private function generateCategoryView(): array "name" => "Wizard.showCarouselNav", ] ], + "displayInfo_showCategoryFilter" => [ + "type" => "checkbox", + "defaultValue" => false, + "options" => [ + "name" => "Wizard.showCategoryFilter", + ] + ], ] ]; }