diff --git a/src/module-elasticsuite-catalog-graph-ql/DataProvider/Product/LayeredNavigation/Builder/Attribute.php b/src/module-elasticsuite-catalog-graph-ql/DataProvider/Product/LayeredNavigation/Builder/Attribute.php index 978f27d41..325a3b78a 100644 --- a/src/module-elasticsuite-catalog-graph-ql/DataProvider/Product/LayeredNavigation/Builder/Attribute.php +++ b/src/module-elasticsuite-catalog-graph-ql/DataProvider/Product/LayeredNavigation/Builder/Attribute.php @@ -107,6 +107,7 @@ public function build(AggregationInterface $aggregation, ?int $storeId): array $label = $attributeCode; try { $attribute = $this->attributeRepository->get($attributeCode); + $label = $attribute->getDefaultFrontendLabel(); $frontendLabels = array_filter( $attribute->getFrontendLabels(), function ($frontendLabel) use ($storeId) { @@ -115,8 +116,6 @@ function ($frontendLabel) use ($storeId) { ); if (!empty($frontendLabels)) { $label = reset($frontendLabels)->getLabel(); - } else { - $label = $attribute->getDefaultFrontendLabel(); } } catch (\Magento\Framework\Exception\NoSuchEntityException $exception) { $label = $attributeCode;