diff --git a/src/FondOfImpala/Zed/ProductImageGroupingProductPageSearch/Communication/Plugin/ProductPageSearch/ProductImageGroupedPageDataLoaderExpanderPlugin.php b/src/FondOfImpala/Zed/ProductImageGroupingProductPageSearch/Communication/Plugin/ProductPageSearch/ProductImageGroupedPageDataLoaderExpanderPlugin.php index f5ee46d..433a174 100644 --- a/src/FondOfImpala/Zed/ProductImageGroupingProductPageSearch/Communication/Plugin/ProductPageSearch/ProductImageGroupedPageDataLoaderExpanderPlugin.php +++ b/src/FondOfImpala/Zed/ProductImageGroupingProductPageSearch/Communication/Plugin/ProductPageSearch/ProductImageGroupedPageDataLoaderExpanderPlugin.php @@ -15,6 +15,11 @@ */ class ProductImageGroupedPageDataLoaderExpanderPlugin extends AbstractPlugin implements ProductPageDataExpanderPluginInterface { + /** + * @var string + */ + protected const IMAGE_GROUP_NAME_EMPTY = '*'; + /** * {@inheritDoc} * @@ -39,7 +44,7 @@ public function expandProductPageData(array $productData, ProductPageSearchTrans foreach ($imageSetsByLocale as $imageSet) { foreach ($productImages as $productImage) { if ($productImage['fk_product_image_set'] === $imageSet->getIdProductImageSet()) { - $regrouped[$imageSet->getName()][] = $productImage; + $regrouped[($imageSet->getName() ?? static::IMAGE_GROUP_NAME_EMPTY)][] = $productImage; } } }