Skip to content

Commit

Permalink
Merged PR 60657: Use array_unique for category names
Browse files Browse the repository at this point in the history
## What's being changed

The output of categories in sales data export.

## Why it's being changed

This was a small regression from the recent refactor. Category names should only be listed once i.e.
```
"MOST_PUR_CATEGORY":"Tees,Performance Fabrics,Default Category"
```
not
```
"MOST_PUR_CATEGORY":"Tees,Tees,Performance Fabrics,Default Category"
```

## How to review / test this change

- To reproduce this happening the wrong way you would need a product in an order line item that had nested categories with the same name as the parent
- Confirm category values are correct

Related work items: #280801
  • Loading branch information
sta1r committed Dec 5, 2024
1 parent a34afb9 commit 8654eaa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Model/Connector/ContactData.php
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ private function getCategoryNamesFromIds(array $categoryIds): string
$names[] = $this->categoryNames[$storeId][$id];
}

return (count($names)) ? implode(',', $names) : '';
return (count($names)) ? implode(',', array_unique($names)) : '';
}

/**
Expand Down

0 comments on commit 8654eaa

Please sign in to comment.