From c7161b81d04146a6f569bb416e23946dd084967e Mon Sep 17 00:00:00 2001 From: mhaagen85 <87481273+mhaagen85@users.noreply.github.com> Date: Tue, 19 Nov 2024 14:34:04 +0100 Subject: [PATCH] Update Attribute.php --- .../Product/LayeredNavigation/Builder/Attribute.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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;