Skip to content

Commit 836cb30

Browse files
author
Ben Robie
committed
Defaulting missing alt-text for a product to use the product name.
#9931
1 parent d30f077 commit 836cb30

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

app/code/Magento/Catalog/Block/Product/View/Gallery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public function getGalleryImagesJson()
116116
'thumb' => $image->getData('small_image_url'),
117117
'img' => $image->getData('medium_image_url'),
118118
'full' => $image->getData('large_image_url'),
119-
'caption' => $image->getLabel(),
119+
'caption' => ($image->getLabel() ?: $this->getProduct()->getName()),
120120
'position' => $image->getPosition(),
121121
'isMain' => $this->isMainImage($image),
122122
'type' => str_replace('external-', '', $image->getMediaType()),

0 commit comments

Comments
 (0)