diff --git a/Block/LayeredNavigation/RenderLayered/DefaultRenderer.php b/Block/LayeredNavigation/RenderLayered/DefaultRenderer.php index f235785e..041859c2 100644 --- a/Block/LayeredNavigation/RenderLayered/DefaultRenderer.php +++ b/Block/LayeredNavigation/RenderLayered/DefaultRenderer.php @@ -238,6 +238,30 @@ public function getLessItemText() return 'Minder filters tonen'; } + /** + * @return bool + */ + public function isSearchable() + { + return ($this->getFacetSettings()->isSearchable() && $this->hasHiddenItems()); + } + + /** + * @return mixed|string|null + */ + public function getSearchPlaceholder() + { + return $this->getFacetSettings()->getSearchPlaceholder(); + } + + /** + * @return mixed|string|null + */ + public function getSearchNoResultsText() + { + return $this->getFacetSettings()->getSearchNoResultsText(); + } + /** * @return bool */ diff --git a/Block/LayeredNavigation/RenderLayered/SwatchRenderer.php b/Block/LayeredNavigation/RenderLayered/SwatchRenderer.php index 588cda29..04b16a56 100644 --- a/Block/LayeredNavigation/RenderLayered/SwatchRenderer.php +++ b/Block/LayeredNavigation/RenderLayered/SwatchRenderer.php @@ -217,4 +217,28 @@ public function shouldDisplayProductCountOnLayer() { return $this->getFacetSettings()->getIsNumberOfResultVisible(); } + + /** + * @return bool + */ + public function isSearchable() + { + return $this->getFacetSettings()->isSearchable(); + } + + /** + * @return mixed|string|null + */ + public function getSearchPlaceholder() + { + return $this->filter->getFacet()->getFacetSettings()->getSearchPlaceholder(); + } + + /** + * @return mixed|string|null + */ + public function getSearchNoResultsText() + { + return $this->filter->getFacet()->getFacetSettings()->getSearchNoResultsText(); + } } diff --git a/Model/Client/Type/FacetType/SettingsType.php b/Model/Client/Type/FacetType/SettingsType.php index 3570abf8..314ce1a6 100644 --- a/Model/Client/Type/FacetType/SettingsType.php +++ b/Model/Client/Type/FacetType/SettingsType.php @@ -210,4 +210,27 @@ public function getCssClass() return null; } + /** + * @return bool + */ + public function isSearchable() + { + return ($this->getBoolValue('issearchable')); + } + + /** + * @return mixed|string|null + */ + public function getSearchPlaceholder() + { + return empty($this->getValue('searchplaceholder')) ? '' : $this->getValue('searchplaceholder'); + } + + /** + * @return mixed|string|null + */ + public function getSearchNoResultsText() + { + return empty($this->getValue('searchnoresultstext')) ? '' : $this->getValue('searchnoresultstext'); + } } diff --git a/view/frontend/templates/product/layered/default.phtml b/view/frontend/templates/product/layered/default.phtml index 347d7e5d..6332d313 100644 --- a/view/frontend/templates/product/layered/default.phtml +++ b/view/frontend/templates/product/layered/default.phtml @@ -21,6 +21,10 @@ $shouldDisplayProductCountLayer = $block->shouldDisplayProductCountOnLayer(); ?>