diff --git a/Block/LayeredNavigation/RenderLayered/LinkRenderer/ItemRenderer.php b/Block/LayeredNavigation/RenderLayered/LinkRenderer/ItemRenderer.php index 76d3f657..f6857b17 100644 --- a/Block/LayeredNavigation/RenderLayered/LinkRenderer/ItemRenderer.php +++ b/Block/LayeredNavigation/RenderLayered/LinkRenderer/ItemRenderer.php @@ -58,6 +58,11 @@ public function hasChildren() */ public function getChildren() { + // When rendering link items we need to remove everything after the first nesting + // because "link view (linkweergave)" has a max of 1 nesting + foreach ($this->item->getChildren() as $child) { + $child->setChildren([]); + } return $this->item->getChildren(); } } diff --git a/Block/Navigation/FilterRenderer/Plugin.php b/Block/Navigation/FilterRenderer/Plugin.php index a35052f7..828a6bdd 100644 --- a/Block/Navigation/FilterRenderer/Plugin.php +++ b/Block/Navigation/FilterRenderer/Plugin.php @@ -99,6 +99,7 @@ public function aroundRender(FilterRenderer $subject, Closure $proceed, FilterIn $facet = $filter->getFacet(); $settings = $facet->getFacetSettings(); $renderType = $settings->getSelectionType(); + if ($this->config->getUseDefaultLinkRenderer() && in_array($renderType, $this->defaultAllowedRenderTypes)) { return $proceed($filter); } @@ -121,10 +122,6 @@ public function aroundRender(FilterRenderer $subject, Closure $proceed, FilterIn */ protected function getBlockType(SettingsType $settings) { - if ($settings->getSource() === SettingsType::SOURCE_CATEGORY) { - return TreeRenderer::class; - } - $renderType = $settings->getSelectionType(); return $this->blockTypes[$renderType] ?? DefaultRenderer::class; } diff --git a/Model/Config.php b/Model/Config.php index 5afb1e64..ddaf49fc 100644 --- a/Model/Config.php +++ b/Model/Config.php @@ -170,7 +170,7 @@ public function getHideSingleOptions(Store $store = null) */ public function getUseDefaultLinkRenderer(Store $store = null) { - return (bool)$this->getStoreConfig('tweakwise/layered/default_link_renderer', $store); + return (bool) $this->getStoreConfig('tweakwise/layered/default_link_renderer', $store); } /** diff --git a/view/frontend/templates/product/layered/link.phtml b/view/frontend/templates/product/layered/link.phtml index f239a0a7..0a515e41 100644 --- a/view/frontend/templates/product/layered/link.phtml +++ b/view/frontend/templates/product/layered/link.phtml @@ -9,7 +9,7 @@ use Emico\Tweakwise\Block\LayeredNavigation\RenderLayered\TreeRenderer; /** @var $block \Emico\Tweakwise\Block\LayeredNavigation\RenderLayered\LinkRenderer */ ?> -
    +