PluginProbe
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler / 1.7.1
FluentCart A New Era of eCommerce – Faster, Lighter, and Simpler v1.7.1
1.7.1 1.7.0 1.6.6 1.6.5 1.6.4 1.6.3 1.6.2 1.6.1 1.6.0 1.5.4 1.5.5 1.5.3 1.5.2 1.5.1 1.5.0 1.4.2 1.4.1 1.4.0 1.3.28 1.3.27 1.3.26 1.3.25 1.3.23 1.3.22 1.3.21 All 51 releases
← All changes | app/Services/Report/DashBoardReportService.php +7 -3 1.3.27 → 1.7.1 View file →
@@ -219,12 +219,16 @@
219 219 $countryLists = Helper::getCountyIsoLists();
220 220
221 221 $other = __('Uncategorized', 'fluent-cart');
222 222 $transformedData = $results->map(function ($item) use ($countryLists, $other) {
223 - $countryName = Arr::get($countryLists, $item->country, $other);
223 + $countryCode = strtoupper((string)$item->country);
224 + $isKnown = isset($countryLists[$countryCode]);
225 +
226 + // `name` is the translated label; the map matches on the locale-stable `country_code`.
224 227 return [
225 - 'name' => $countryName,
226 - 'value' => (int)$item->value,
228 + 'country_code' => $isKnown ? $countryCode : null,
229 + 'name' => $isKnown ? $countryLists[$countryCode] : $other,
230 + 'value' => (int)$item->value,
227 231 ];
228 232 })->toArray();
229 233
230 234 // sort by value