Skip to content

Commit

Permalink
Update Attribute.php
Browse files Browse the repository at this point in the history
  • Loading branch information
mhaagen85 authored Nov 19, 2024
1 parent 16d3797 commit c7161b8
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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;
Expand Down

0 comments on commit c7161b8

Please sign in to comment.